Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (30 sloc) 1.38 KB
// Decorates any maven repository declarations with Artifactory credentials
// in order to respond to 401 auth challenges that may occur when requesting
// artifacts that have not previously been cached on the server.
// See https://github.com/SpringSource/gradle-init-scripts#readme for details.
// Requires Gradle 1.0-milestone-6 or better in order work with newer
// "maven { url ... }" repository syntax. Will cause errors against earlier
// versions.
logger.info('Applying init.gradle to add Artifactory credentials')
gradle.projectsLoaded {
rootProject.allprojects {
buildscript {
repositories.withType(org.gradle.api.artifacts.repositories.MavenArtifactRepository).matching {
it.url.host == 'repo.springsource.org' || it.url.host == 'repo.spring.io'
}.all {
credentials {
username = '${security.getCurrentUsername()}'
password = '${security.getEncryptedPassword()}'
}
}
}
repositories.withType(org.gradle.api.artifacts.repositories.MavenArtifactRepository).matching {
it.url.host == 'repo.springsource.org' || it.url.host == 'repo.spring.io'
}.all {
credentials {
username = '${security.getCurrentUsername()}'
password = '${security.getEncryptedPassword()}'
}
}
}
}