This step can be used to automate releases using Jenkins.
Basically the execMavenRelease
step calls the
execMaven
step with the goals release:prepare
and
release:perform
, but with a little bit of magic around it.
The step only allows releases via git+ssh! Release via http(s) is currently not supported.
You can use this step only from the master
branch! The step will fail
for any other branch!
- Create/configure a user with the appropriate rights got the branch (master)
- Create/configure a ssh key pair for this user and configure that key in Jenkins
- Configure the ssh credential auto lookup (see
sshAgentWrapper
for details)
You need at least the version 2.5.3 of the maven release plugin. Versions prior 2.5.3 had some problems with committing to git.
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
</plugin>
</plugins>
</pluginManagement>
</build>
The step performs some steps to ensure that everything is configured and used correctly to save you some time deleting wrong scm tags and artifacts from your artifact manager
- Check SCM
- Check if scm url is a git ssh url
(
git@someserver:group/project.git
) - Check if scm branch is
master
. - fail if there is any error
- Check if scm url is a git ssh url
(
- Check plugin versions
- Generating the effective pom by using the execMaven step with the
goals
help:effective-pom
with output toeffective-pom.tmp
- Read the effective pom and checking for the correct maven-release-plugin version
- fail if there is any error
- Generating the effective pom by using the execMaven step with the
goals
- Wrap the execMaven step by using the
sshAgentWrapper
step - Call
execMaven
withrelease:prepare release:perform
The execMavenRelease
step has no dedicated configuration options. Have
a look at the configuration options for the
execMaven
configuration options for more information