• Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • gradle-plugin
    • None

      When using the gradle plugin for builds, it's possible to select the gradle wrapper instead of the gradle application. However, using the gradle wrapper, it's not possible to specify the location of the gradle wrapper script.

          [JENKINS-12769] Cannot specify location of gradle wrapper

          cjyar created issue -

          Another way to reproduce:

          • you have a set of gradle projects (one of them is the "master" project and the remaining ones are subprojects) each of them is in an appropriate subdirectory of the workspace, each having its own build.gradle file.
          • you need to invoke gradlew in the master project, so you specify "Root build script" = "${workspace}/master", or simply "master".
          • The plugin still tries to execute gradlew from the workspace root, seems to ignore the "Root build script setting".

          Cheers,

          Marco

          Marco Trevisan added a comment - Another way to reproduce: you have a set of gradle projects (one of them is the "master" project and the remaining ones are subprojects) each of them is in an appropriate subdirectory of the workspace, each having its own build.gradle file. you need to invoke gradlew in the master project, so you specify "Root build script" = "${workspace}/master", or simply "master". The plugin still tries to execute gradlew from the workspace root, seems to ignore the "Root build script setting". Cheers, Marco

          merscwog added a comment -

          This is a current blocker for attempting to utilize this gradle plugin and the gradle wrapper together for several valid use cases. There were two highly generalized solutions that are in pull requests from about 3 months ago (there might be some reason why they were not incorporated, as I've not tested either). I submitted a limited solution just over a week ago as a pull request that simply allows gradlew to selectively be found in the same directory as the root build file or workspace top, which required very minor modifications to the existing code base.

          merscwog added a comment - This is a current blocker for attempting to utilize this gradle plugin and the gradle wrapper together for several valid use cases. There were two highly generalized solutions that are in pull requests from about 3 months ago (there might be some reason why they were not incorporated, as I've not tested either). I submitted a limited solution just over a week ago as a pull request that simply allows gradlew to selectively be found in the same directory as the root build file or workspace top, which required very minor modifications to the existing code base.
          Gregory Boissinot made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          David Pärsson added a comment - - edited

          What if the gradlew file does not reside in the root build script project? We're in the situation where we have a multi-project Gradle build, but we don't always want to build from the master directory (where gradlew resides).

          I'd like the ability to supply a relative path to gradlew, or a relative folder where gradlew resides. That path should ideally be relative to the workspace root.

          David Pärsson added a comment - - edited What if the gradlew file does not reside in the root build script project? We're in the situation where we have a multi-project Gradle build, but we don't always want to build from the master directory (where gradlew resides). I'd like the ability to supply a relative path to gradlew, or a relative folder where gradlew resides. That path should ideally be relative to the workspace root.
          David Pärsson made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          I found how to solve my issue with the existing functionality. Make master the root build script project, and execute mySubProject:myTask. Almost too simple!

          David Pärsson added a comment - I found how to solve my issue with the existing functionality. Make master the root build script project, and execute mySubProject:myTask. Almost too simple!
          David Pärsson made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Reopened [ 4 ] New: Resolved [ 5 ]

          gbois do you know which commit this was part of which resolved this issue?

          Steven Christou added a comment - gbois do you know which commit this was part of which resolved this issue?

          gbois Sorry, I just found it: PR 13

          Steven Christou added a comment - gbois Sorry, I just found it: PR 13

            gbois Gregory Boissinot
            cjyar cjyar
            Votes:
            15 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: