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 : String
(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
globalMavenSettingsFilePath : String
(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
jdk : String
(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.
maven : String
(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.
mavenLocalRepo : String
(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.
mavenOpts : String
(optional)
Shell-like environment variable expansions work in this field, by using the ${VARIABLE}
syntax.
mavenSettingsConfig : String
(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
mavenSettingsFilePath : String
(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
options
(optional)
concordionPublisher
disabled : boolean
(optional)
dependenciesFingerprintPublisher
disabled : boolean
(optional)
includeReleaseVersions : boolean
(optional)
includeScopeCompile : boolean
(optional)
includeScopeProvided : boolean
(optional)
includeScopeRuntime : boolean
(optional)
includeScopeTest : boolean
(optional)
includeSnapshotVersions : boolean
(optional)
findbugsPublisher
org.codehaus.mojo:findbugs-maven-plugin:findbugs
".
disabled : boolean
(optional)
healthy : String
(optional)
thresholdLimit : String
(optional)
unHealthy : String
(optional)
artifactsPublisher
archiveFilesDisabled : boolean
(optional)
disabled : boolean
(optional)
fingerprintFilesDisabled : boolean
(optional)
invokerPublisher
org.apache.maven.plugins:maven-invoker-plugin:run
".
disabled : boolean
(optional)
jgivenPublisher
disabled : boolean
(optional)
jacocoPublisher
disabled : boolean
(optional)
junitPublisher
maven-surefire-plugin:test
" or by "maven-failsafe-plugin:integration-test
".
disabled : boolean
(optional)
healthScaleFactor : double
(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% healthignoreAttachments : boolean
(optional)
keepLongStdio : boolean
(optional)
mavenLinkerPublisher
disabled : boolean
(optional)
pipelineGraphPublisher
disabled : boolean
(optional)
ignoreUpstreamTriggers : boolean
(optional)
includeReleaseVersions : boolean
(optional)
includeScopeCompile : boolean
(optional)
includeScopeProvided : boolean
(optional)
includeScopeRuntime : boolean
(optional)
includeScopeTest : boolean
(optional)
includeSnapshotVersions : boolean
(optional)
lifecycleThreshold : String
(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 requestsskipDownstreamTriggers : boolean
(optional)
spotbugsPublisher
com.github.spotbugs:spotbugs-maven-plugin:spotbugs
".
disabled : boolean
(optional)
healthy : String
(optional)
thresholdLimit : String
(optional)
unHealthy : String
(optional)
openTasksPublisher
FIXME
" comments as high priority tasks and for "TODO
" comments as normal priority tasks.
asRegexp : boolean
(optional)
disabled : boolean
(optional)
excludePattern : String
(optional)
healthy : String
(optional)
highPriorityTaskIdentifiers : String
(optional)
ignoreCase : boolean
(optional)
lowPriorityTaskIdentifiers : String
(optional)
normalPriorityTaskIdentifiers : String
(optional)
pattern : String
(optional)
thresholdLimit : String
(optional)
unHealthy : String
(optional)
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 : String
(optional)
traceability : boolean
(optional)
Note: This option adds --show-version
to the maven execution and marks the beginning of the maven wrapper script with ----- withMaven Wrapper script -----
.
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.