Permalink
Browse files

Update to allow use of Gradle 1.0 GA and better

  • Loading branch information...
1 parent 05dc4cd commit a116bc40f63c638f58efc14befec3c4e2c312712 @cbeams cbeams committed Jun 21, 2012
Showing with 12 additions and 14 deletions.
  1. +12 −14 init.gradle
View
@@ -5,27 +5,25 @@
// 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. Acts as a no-op for earlier versions.
-if (gradle.gradleVersion >= '1.0-milestone-6') {
+// "maven { url ... }" repository syntax. Will cause errors against earlier
+// versions.
+logger.info('Applying init.gradle to add Artifactory credentials')
- 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' }.all {
- credentials {
- username = '${security.getCurrentUsername()}'
- password = '${security.getEncryptedPassword()}'
- }
- }
- }
+gradle.projectsLoaded {
+ rootProject.allprojects {
+ buildscript {
repositories.withType(org.gradle.api.artifacts.repositories.MavenArtifactRepository).matching { it.url.host == 'repo.springsource.org' }.all {
credentials {
username = '${security.getCurrentUsername()}'
password = '${security.getEncryptedPassword()}'
}
}
}
+ repositories.withType(org.gradle.api.artifacts.repositories.MavenArtifactRepository).matching { it.url.host == 'repo.springsource.org' }.all {
+ credentials {
+ username = '${security.getCurrentUsername()}'
+ password = '${security.getEncryptedPassword()}'
+ }
+ }
}
}

2 comments on commit a116bc4

Member

dturanski replied Jul 25, 2012

This works great on my local machine but failed on the bamboo server until I added the credentials {} directly to build.gradle. You can recreate by trying to access something in https://repo.springsource.org/ext-private-local.

Contributor

cbeams replied Aug 2, 2012

@dturanski - assuming that (a) the build server's init.gradle is up to date with the changes here and (b) your build is set up to use the gradle wrapper on both your local machine and the build server, I don't see what would be causing this to fail. Can you confirm that both (a) and (b) are true?

Please sign in to comment.