{jenkins-plugin-info:gradle}

This plugin makes it possible to invoke a Gradle build script as the main build step.
It also allows detecting Build Scans in arbitrary console logs, for Maven and Gradle builds and display them in the Jenkins UI.

Description

This plugin adds Gradle Support to Jenkins. Gradle is managed as another tool inside Jenkins (the same way as Ant or Maven),
including support for automatic installation and a new build step is provided to execute Gradle tasks.

It also allows detecting Build Scans in arbitrary console logs, for Maven and Gradle builds and display them in the Jenkins UI.

Configuration

Gradle configuration is performed in the Configure System (before Jenkins 2.0) or Global Tool Configuration (starting in Jenkins 2.0). In both cases these options reside in the Manage Jenkins section.

In the Gradle section provided by this plugin, several installations can be configured:

The system provides both automatic installation, which can be performed by directly downloading from the Gradle web site, extracting a compressed final or executing some shell commands.
Besides, for nodes which already has Gradle installed, the tool can by manually configured, by unchecking the Install automatically checkbox and providing the base path (GRADLE_HOME) of the installation.

Usage

The Gradle plugin provides an Invoke Gradle script build step.

The first configuration option is whether to use one of the installation configured in Jenkins (see previous section) of use the Gradle Wrapper
which is the Gradle-provided mechanism to "embed" the use of a specific Gradle version in a build, installing it if neccessary.

Other configuration options include:

If a Gradle Build Scan is produced during a build, then a link to it is added to the build page.

Capturing build scans from console log

If you are not using the provided build scan, you can still configure to detect published (Maven or Gradle) Build Scans from the console log. For doing so, go to Build Environment and check Inspect build log for published Gradle build scans.

If build scans are detected in the console log of a build, a badge will be added to the build page. This works for Build Scans produced by Gradle and Maven builds.

Capturing build scans from Jenkins Pipeline

When using Jenkins pipeline, there is the command findBuildScans which can be used to find the build scans emitted by Gradle builds and show them on the build page.

Roadmap

Changelog

1.33 (July 5th 2019)

1.32 (May 24th 2019)

1.31 (Mar 16th 2019)

1.30 (Jan 11th 2019)

Release 1.29 (Jul 3rd 2018)

Release 1.28 (Oct 2 2017)

Release 1.27 (Jun 23 2017)

Release 1.26 (Feb 13 2017)

Release 1.25

Release 1.24

* Fix JENKINS-18629 - Jenkins fails to save configuration when using Invoke Gradle script in Conditional Step (single).

Release 1.23

* Fix issue #17386 - Gradle.properties ignored after 1.22 upgrade. GRADLE_USER_HOME is now no longer set to the workspace of the job by default. If you wish to have the workspace job as the GRADLE_USER_HOME, you will need to change the config to reflect this.

Release 1.22

* Fix JENKINS-17294 - mask sensitive variables (Password parameters)
* Fix JENKINS-13412 - use hudson.util.ArgumentListBuilder#toWindowsCommand
* Set GRADLE_USER_HOME all the time

Release 1.21

* Add the ability to allow gradlew to still be run from workspace top, but to also configure it so that gradlew is found in the root build script directory.
* Fix JENKINS-12769 - Cannot specify location of gradle wrapper
* Fix JENKINS-15406 - When using gradlew, root build script field is not used to locate gradlew

Release 1.20

* Fix JENKINS-15166 - Gradle plugin fails to save selected Gradle Version in Project configuration

Release 1.19

* Fix broken file permission introduced by JENKINS-14780

Release 1.18

* Fix JENKINS-14780 - make gradlew script executable

Release 1.17

* Merge pull request - Change Gradle Wrapper logic to use the launcher's OS type rather than master's OS type when determining Gradle Wrapper script name

Release 1.16

* Fix reopened JENKINS-9538 - hudson.model.FreeStyleBuild & GradleInstallation not serializable => Gradle build not working anymore

Release 1.15

* Fix reopened JENKINS-13412 - Gradle plugin fails to quote parameters without whitespace when containing input/output redirection symbols, e.g. in XML strings

Release 1.14

* Fix JENKINS-13412 - Gradle plugin fails to quote parameters without whitespace when containing input/output redirection symbols, e.g. in XML strings

Release 1.13

* Fix JENKINS-9538 - hudson.model.FreeStyleBuild & GradleInstallation not serializable => Gradle build not working anymore

Release 1.12 (October 30, 2011)

* Fix JENKINS-9553 - Gradle wrapper command fails on Windows

Release 1.11 (October 02, 2011)

Release 1.10 (September 07, 2011)

Release 1.9 (June 24, 2011)

Release 1.8 (April 01, 2011)

Release 1.7.1 (March 24, 2011)

Release 1.7 (March 23, 2011)

Release 1.6 (February 27, 2011)

Release 1.5 (February 19, 2011)

Release 1.4 (June, 09, 2010)

Release 1.3 (February 23, 2010)

Release 1.2 (February 07, 2009)

Release 1.1 (November 07, 2008)

Release 1.0 (October 04, 2008)