{jenkins-plugin-info:pluginId=maven-plugin|jiraComponent=maven-plugin}

Maven jobs and Java versions compatibility : Because java serialized classes are exchanged between Jenkins master and Maven Jobs it is required that the JVM used to launch Maven is superior or equal to the version of Java for which Jenkins Master is built for.

  • Jenkins >= 1.520 requires Java 6 thus Maven jobs must be launched with Java >= 6.
  • Jenkins >= 1.612 requires Java 7 thus Maven jobs must be launched with Java >= 7.
  • Jenkins >= 2.54 requires Java 8 thus Maven jobs must be launched with Java >= 8.

See also JENKINS-18403, JENKINS-28294

If Jenkins detects that you are trying to use a JDK older than the master prerequisite, it automatically reconfigure your build to use the JDK on which your agent is running. It displays in your build logs a message like :

ERROR: ================================================================================
ERROR: Invalid project setup: hudson/maven/AbstractMavenProcessFactory$ConfigureOriginalJDK : Unsupported major.minor version 51.0
ERROR: [JENKINS-18403][JENKINS-28294] JDK 'j6' not supported to run Maven projects.
ERROR: Maven projects have to be launched with a Java version greater or equal to the minimum version required by the master.
ERROR: Use the Maven JDK Toolchains (plugin) to build your maven project with an older JDK.
ERROR: Retrying with slave Java and setting compile/test properties to point to /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/.
ERROR: ================================================================================

But due to the remoting upgrade in Jenkins 2.27+ this workaround doesn't work anymore if your agent or maven job is using Java < 7 - JENKINS-40990 (Because remoting is compiled for Java 7)

Known issues are listed in Jira.

Historically this plugin was released alongside Jenkins core releases. Since version 2.0 this plugin is released separately, but still bundled with Jenkins - though not always the newest version of the plugin might be bundled.

This plugin provides an advanced integration for Maven 2/3 projects.

Even if Jenkins provides natively a Maven builder to use a build step in classical Jenkins jobs (freestyle, ...) this plugin provides a more advanced integration with specific a specific job type providing uniq features like:

See Building a maven2 project for more information on how to use this.

Environment Variables

This plugin exposes variables found from the project's POM (as of version 2.1):

And many others features provided by Jenkins plugins ecosystem

Release Notes

Version 3.4 (July 31st, 2019)

Version 3.3 (June 14th, 2019)

Version 3.2 (November 30th, 2018)

Version 3.1.2 (March 27th, 2018)

Version 3.1.1 (March 25th, 2018)

Version 3.1 (January 24th, 2018)

Version 3.0 (October 6th, 2017)

Version 2.17 (July 10, 2017)

Version 2.16 (June 08, 2017)

Version 2.15.1 (Feb 16, 2017)

Version 2.15 (Feb 16, 2017)

Release failed .... thx repo.jenkins-ci.org

Version 2.14 (Oct 18, 2016)

Requires now Jenkins >= 1.625.3 and Java >= 7

Version 2.13 (May 19, 2016)

Version 2.12.1 (Oct 01, 2015)

Version 2.12 (Aug 27, 2015)

Version 2.11 (Aug 07, 2015)

This version requires Jenkins 1.580.1 or later.

Version 2.10 (Jun 08, 2015)

Version 2.9 (March 18, 2015)

Version 2.8 (Nov 21, 2014)

Version 2.7 (Oct 10, 2014)

Version 2.6 (Aug 11 2014)

Version 2.5 (Jul 11 2014)

Version 2.4 (Jul 03 2014)

Version 2.3 (Apr 30 2014)

Version 2.2 (Apr 3 2014)

Version 2.1 (Dec 17 2013); requires 1.538+

Version 2.0.4 (Jul 03 2014)

Version 2.0.3 (Jan 28, 2014)

Version 2.0.2 (Jan 23, 2014)

Version 2.0.1 (Jan 04, 2014)

Version 2.0 (Oct 22, 2013)