• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • gradle-plugin
    • None
    • Ubuntu Linux 12.04; Jenkins 1.508; Gradle 1.4

      Our builds use $HOME/.gradle/gradle.properties to store secrets (i.e. Artifactory username/password).
      After upgrading to 1.22, this file does not seem to be loaded.

      Likely related: https://github.com/jenkinsci/gradle-plugin/commit/e3c13fb8ad5929d33dc657de24a2ba6e715c8a02

      Possible workarounds:

      • Revert to 1.21
      • Copy the file into the workspace via shell (or some other pre-gradle step)

          [JENKINS-17386] Gradle.properties ignored after 1.22 upgrade

          +1 also a problem for us, global properties & nexus creds were in $HOME/.gradle, had to revert to 1.21

          Jeffrey Damick added a comment - +1 also a problem for us, global properties & nexus creds were in $HOME/.gradle, had to revert to 1.21

          +1: same problem that $HOME/.gradle/gradle.properties is used for credentials. What's the reason for setting GRADLE_USER_HOME to job's workspace? We are making heavy use of gradle wrapper. Gradle distributions being installed per job instead of being shared nastily impacts the storage size.

          Jochen Hinrichsen added a comment - +1: same problem that $HOME/.gradle/gradle.properties is used for credentials. What's the reason for setting GRADLE_USER_HOME to job's workspace? We are making heavy use of gradle wrapper. Gradle distributions being installed per job instead of being shared nastily impacts the storage size.

          Christian Hepworth added a comment - - edited

          This is also a problem for us. However, I reverted back to version 1.21 but the file is still not being found. When in the HOME/.gradle directory.

          Also, why would the plugin have different defaults to the gradle tool itself?

          Christian Hepworth added a comment - - edited This is also a problem for us. However, I reverted back to version 1.21 but the file is still not being found. When in the HOME/.gradle directory. Also, why would the plugin have different defaults to the gradle tool itself?

          166_MMX added a comment -

          It breaks our builds too since we depend on $HOME/.gradle/gradle.properties too

          166_MMX added a comment - It breaks our builds too since we depend on $HOME/.gradle/gradle.properties too

          My workaround was to add -Dgradle.user.home=$HOME/.gradle to the switches in the job config. Note that -Dgradle.user.home=$HOME did not work, it had to be -Dgradle.user.home=$HOME/.gradle

          Christian Hepworth added a comment - My workaround was to add -Dgradle.user.home=$HOME/.gradle to the switches in the job config. Note that -Dgradle.user.home=$HOME did not work, it had to be -Dgradle.user.home=$HOME/.gradle

          Doug Borg added a comment -

          As others have stated, changing the GRADLE_HOME to be inside the workspace is not expected behavior, breaks things for many people, and should be there as an option for those who want it and NOT be the default. Also, this change was very poorly communicated in the changelog. "Always set GRADLE_HOME" doesn't really describe what changed.

          Doug Borg added a comment - As others have stated, changing the GRADLE_HOME to be inside the workspace is not expected behavior, breaks things for many people, and should be there as an option for those who want it and NOT be the default. Also, this change was very poorly communicated in the changelog. "Always set GRADLE_HOME" doesn't really describe what changed.

          I see that Nicolas De loof has provided a pull request (https://github.com/jenkinsci/gradle-plugin/pull/16/) that looks like it should fix this issue. I'm not sure the process for getting it merged in but I suggest we do it soon and push a release since its been 3 months since it "broke".

          Richard Bywater added a comment - I see that Nicolas De loof has provided a pull request ( https://github.com/jenkinsci/gradle-plugin/pull/16/ ) that looks like it should fix this issue. I'm not sure the process for getting it merged in but I suggest we do it soon and push a release since its been 3 months since it "broke".

          After no objections on the Jenkins mailing list, I have just deployed a 1.23 release with Nicolas' change. There is now an option to use the workspace as the GRADLE_USER_HOME with the default being the old setting which should fix the issue for a number of people.

          Not sure how long the release takes to show but hopefully won't be long.

          Richard Bywater added a comment - After no objections on the Jenkins mailing list, I have just deployed a 1.23 release with Nicolas' change. There is now an option to use the workspace as the GRADLE_USER_HOME with the default being the old setting which should fix the issue for a number of people. Not sure how long the release takes to show but hopefully won't be long.

          Release 1.23 performed to make GRADLE_USER_HOME of workspace an option.

          Richard Bywater added a comment - Release 1.23 performed to make GRADLE_USER_HOME of workspace an option.

          Bart Bialek added a comment - - edited

          Richard, I have version 1.24 installed... where is this option exposed? I can't find it.

          I see it now under each Job's Gradle options: "Force GRADLE_USER_HOME to use workspace". Is there a way to make this global for all Jobs?

          Bart Bialek added a comment - - edited Richard, I have version 1.24 installed... where is this option exposed? I can't find it. I see it now under each Job's Gradle options: "Force GRADLE_USER_HOME to use workspace". Is there a way to make this global for all Jobs?

            gbois Gregory Boissinot
            pwagner Pete Wagner
            Votes:
            15 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved: