Last active
January 3, 2016 22:19
-
-
Save xnickmx/8528048 to your computer and use it in GitHub Desktop.
How to store credentials for multiple Maven repos in a properties file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final properties = new Properties() | |
properties.load(new FileInputStream(System.getProperty("user.home") + "/.grails/maven.properties")) | |
final mavenUsername = properties.getProperty("user") | |
final mavenPassword = properties.getProperty("password") | |
mavenRepo ("http://repo.mycompany.com:8081/artifactory/libs-release-local") { | |
auth([ | |
username: mavenUsername, | |
password: mavenPassword | |
]) | |
} | |
mavenRepo ("http://repo.mycompany.com:8081/artifactory/remote-repos") { | |
auth([ | |
username: mavenUsername, | |
password: mavenPassword | |
]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment