As of 1.26, it doesn't look like the Gradle plugin is setting PATH+GRADLE, so it's not getting added to the PATH automatically by the tool step (or in Declarative when you specify Gradle in the tools directive, which uses tool behind the scenes anyway). That should be fixed.

          [JENKINS-42381] GradleInstallation not setting PATH+GRADLE

          Andrew Bayer added a comment -

          Andrew Bayer added a comment - PR up at https://github.com/jenkinsci/gradle-plugin/pull/42

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          src/main/java/hudson/plugins/gradle/GradleInstallation.java
          src/test/groovy/hudson/plugins/gradle/GradlePluginIntegrationTest.groovy
          http://jenkins-ci.org/commit/gradle-plugin/96e82f0a2140f72d8944f3c0435f81537d2f6ae7
          Log:
          [FIXED JENKINS-42381] Add PATH+GRADLE and buildEnvVars(...)

          This ensures that Gradle's bin directory ends up on the PATH when
          using the Pipeline tool step. Note that Jenkins' environment variable
          management will handle converting "/bin" on Windows if needed, we do
          not need to do that explicitly.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/java/hudson/plugins/gradle/GradleInstallation.java src/test/groovy/hudson/plugins/gradle/GradlePluginIntegrationTest.groovy http://jenkins-ci.org/commit/gradle-plugin/96e82f0a2140f72d8944f3c0435f81537d2f6ae7 Log: [FIXED JENKINS-42381] Add PATH+GRADLE and buildEnvVars(...) This ensures that Gradle's bin directory ends up on the PATH when using the Pipeline tool step. Note that Jenkins' environment variable management will handle converting "/bin" on Windows if needed, we do not need to do that explicitly.

          Stefan Wolf added a comment -

          1.27 has been released.

          Stefan Wolf added a comment - 1.27 has been released.

            abayer Andrew Bayer
            abayer Andrew Bayer
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: