Licensed under [MIT Licence].
Allows you to perform given pipeline step(s) on a job and all its linked jobs.
Linked jobs are the upstreams of the job, derived from maven dependencies. Dependency graph can be visualized using Dependency Graph View Plugin.
The plugin can be used to preform a clean build in the isolated environment for the group of dependent projects.
Example of pipeline configuration:
node {
stage('build') {
echo "cleanup workspace"
deleteDir()
mvnRepo=pwd() + "/m2" // set local maven repo
echo "use maven repo $mvnRepo"
walk job: 'parent-project', jobAction: '''
dir(JOB_NAME) {
git url: JOB_SCM_URL, branch: JOB_SCM_BRANCH, credentialsId: JOB_SCM_CREDINTIALS_ID
withMaven(maven: 'mvn', mavenLocalRepo: mvnRepo) {
sh "mvn clean install"
}
}
'''
}
}
Another use case is a multiple release. When the release action
(see Release Plugin or
M2 Release Plugin) is defined
in a way that it drops SNAPSHOT keyword from dependencies, than using this plugin one can trigger
a consistent release of multiple modules.
In this scenario release should first update dependencies, for example invoking following maven target:
versions:use-releases scm:checkin -Dmessage="drop snapshot versions"
In some way the plugin is an alternative to Maven Cascade Release Plugin.
Example of pipeline configuration:
node {
stage('build') {
walk job: 'parent-project', failOnUnstable: true, jobAction: 'release JOB_NAME'
}
}
First run a development instance of jenkins by executing a command mvn hpi:run
Go to jenkins development instance and configure as following:
- In system configuration click on
Maven installations...
button and configure:
- Set
Name
tomvn
- deselect
Install automatically
- set
MAVEN_HOME
to your local maven installation (e.g./usr/share/maven
)
- In plugin manager install following plugins with restart: