The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.
For a list of other such plugins, see the Pipeline Steps Reference page.
withMaven
: Provide Maven environmentsh mvn
or bat mvn
. The selected maven installation will be configured and prepended to the path.
globalMavenSettingsConfig
(optional)
settings.xml
file contains elements used to define values which configure Maven execution in various ways, like the pom.xml
, but should not be bundled to any specific project, or distributed to an audience. These include values such as the local repository location, alternate remote repository servers, and authentication information.
see also: settings.xml
reference
String
globalMavenSettingsFilePath
(optional)
settings.xml
file contains elements used to define values which configure Maven execution in various ways, like the pom.xml
, but should not be bundled to any specific project, or distributed to an audience. These include values such as the local repository location, alternate remote repository servers, and authentication information.
settings.xml
file per default may live:
$M2_HOME/conf/settings.xml
${user.home}/.m2/settings.xml
see also: settings.xml
reference
String
jdk
(optional)
Note: This option does not work with docker.image('xxx').inside
or container('xxx')
, the preinstalled JDK on the docker image will be used.
String
maven
(optional)
Note: This option does not work with docker.image('xxx').inside
or container('xxx')
, the preinstalled maven on the docker image will be used.
String
mavenLocalRepo
(optional)
~/.m2/repository
and can be overridden by <localRepository> in ~/.m2/settings.xml
(see Configuring your Local Repository))
This normally means that all the jobs that are executed on the same node shares a single Maven repository. The upside of this is that you can save the disk space, the downside is that the repository is not multi process safe and having multiple builds run concurrently can corrupt it. Additionally builds could interfere with each other by sharing incorrect or partially built artifacts. For example, you might end up having builds incorrectly succeed, just because your have all the dependencies in your local repository, despite that fact that none of the repositories in POM might have them.
By using this option, Jenkins will tell Maven to use a custom path for the build as the local Maven repository by using -Dmaven.repo.local
If specified as a relative path then this value well be resolved against the workspace root and not the current working directory.
ie. if .repository
is specified then $WORKSPACE/.repository
will be used.
This means each job could get its own isolated Maven repository just for itself. It fixes the above problems, at the expense of additional disk space consumption.
When using this option, consider setting up a Maven artifact manager so that you don't have to hit remote Maven repositories too often.
String
mavenOpts
(optional)
Shell-like environment variable expansions work in this field, by using the ${VARIABLE}
syntax.
String
mavenSettingsConfig
(optional)
settings.xml
file contains elements used to define values which configure Maven execution in various ways, like the pom.xml
, but should not be bundled to any specific project, or distributed to an audience. These include values such as the local repository location, alternate remote repository servers, and authentication information.
see also: settings.xml
reference
String
mavenSettingsFilePath
(optional)
settings.xml
file contains elements used to define values which configure Maven execution in various ways, like the pom.xml
, but should not be bundled to any specific project, or distributed to an audience. These include values such as the local repository location, alternate remote repository servers, and authentication information.
settings.xml
file per default may live:
$M2_HOME/conf/settings.xml
${user.home}/.m2/settings.xml
see also: settings.xml
reference
String
options
(optional)
concordionPublisher
disabled
(optional)
boolean
dependenciesFingerprintPublisher
disabled
(optional)
boolean
includeReleaseVersions
(optional)
boolean
includeScopeCompile
(optional)
boolean
includeScopeProvided
(optional)
boolean
includeScopeRuntime
(optional)
boolean
includeScopeTest
(optional)
boolean
includeSnapshotVersions
(optional)
boolean
findbugsPublisher
org.codehaus.mojo:findbugs-maven-plugin:findbugs
".
disabled
(optional)
boolean
healthy
(optional)
String
thresholdLimit
(optional)
String
unHealthy
(optional)
String
artifactsPublisher
disabled
(optional)
boolean
invokerPublisher
org.apache.maven.plugins:maven-invoker-plugin:run
".
disabled
(optional)
boolean
jgivenPublisher
disabled
(optional)
boolean
jacocoPublisher
disabled
(optional)
boolean
junitPublisher
maven-surefire-plugin:test
" or by "maven-failsafe-plugin:integration-test
".
disabled
(optional)
boolean
healthScaleFactor
(optional)
1.0
0.0
will disable the test result contribution to build health score.0.1
means that 10% of tests failing will score 99% health0.5
means that 10% of tests failing will score 95% health1.0
means that 10% of tests failing will score 90% health2.0
means that 10% of tests failing will score 80% health2.5
means that 10% of tests failing will score 75% health5.0
means that 10% of tests failing will score 50% health10.0
means that 10% of tests failing will score 0% healthdouble
ignoreAttachments
(optional)
boolean
keepLongStdio
(optional)
boolean
mavenLinkerPublisher
disabled
(optional)
boolean
pipelineGraphPublisher
disabled
(optional)
boolean
ignoreUpstreamTriggers
(optional)
boolean
includeReleaseVersions
(optional)
boolean
includeScopeCompile
(optional)
boolean
includeScopeProvided
(optional)
boolean
includeScopeRuntime
(optional)
boolean
includeScopeTest
(optional)
boolean
includeSnapshotVersions
(optional)
boolean
lifecycleThreshold
(optional)
Threshold to trigger downstream pipelines based on the Maven lifecycle phase successfully reached during the Maven execution.
If "install" is selected then downstream pipelines will be triggered for "mvn clean install
", "mvn clean deploy
" but NOT "mvn clean verify
" or "mvn clean package
".
Configure a Jenkins Multibranch Pipeline with
deploy
"mvn clean deploy
" on branches (incl. master) and execution of "mvn clean verify
on pull requestsString
skipDownstreamTriggers
(optional)
boolean
spotbugsPublisher
com.github.spotbugs:spotbugs-maven-plugin:spotbugs
".
disabled
(optional)
boolean
healthy
(optional)
String
thresholdLimit
(optional)
String
unHealthy
(optional)
String
openTasksPublisher
FIXME
" comments as high priority tasks and for "TODO
" comments as normal priority tasks.
asRegexp
(optional)
boolean
disabled
(optional)
boolean
excludePattern
(optional)
String
healthy
(optional)
String
highPriorityTaskIdentifiers
(optional)
String
ignoreCase
(optional)
boolean
lowPriorityTaskIdentifiers
(optional)
String
normalPriorityTaskIdentifiers
(optional)
String
pattern
(optional)
String
thresholdLimit
(optional)
String
unHealthy
(optional)
String
publisherStrategy
(optional)
IMPLICIT |
All Maven publishers are implicitly enabled and used, even if they are not configured in "withMaven(options:...) ". |
EXPLICIT |
Only the Maven publishers explicitly configured in "withMaven(options:...) " are used. |
IMPLICIT
, EXPLICIT
tempBinDir
(optional)
String
traceability
(optional)
Note: This option adds --show-version
to the maven execution and marks the beginning of the maven wrapper script with ----- withMaven Wrapper script -----
.
boolean
Please submit your feedback about this page through this quick form.
Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?
See existing feedback here.