Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update to allow use of Gradle 1.0 GA and better

  • Loading branch information...
commit a116bc40f63c638f58efc14befec3c4e2c312712 1 parent 05dc4cd
@cbeams cbeams authored
Showing with 12 additions and 14 deletions.
  1. +12 −14 init.gradle
View
26 init.gradle
@@ -5,21 +5,13 @@
// 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()}'
@@ -27,5 +19,11 @@ if (gradle.gradleVersion >= '1.0-milestone-6') {
}
}
}
+ 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

@dturanski

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.

@cbeams

@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.
Something went wrong with that request. Please try again.