Apache MavenPerform a Release


Introduction

The standard Maven plugin used by a Release Process is the maven-release-plugin – the configuration for this plugin is minimal:

SCM in the Maven pom:The Release process will interact with the Source Control of the project – this means we need to define the "scm" element in our pom.xml.The "scm" element for a release build should contain enough information to check out the tag that was created for this release.

Remarks

Note: Make sure to use maven release plugin 2.5 or later to avoid maven related issues. The Release Process

mvn release:clean

The above command will perform the below : delete the release descriptor (release.properties) delete any backup POM files

mvn release:prepare

Next part of the Release process is Preparing the Release; this will: perform some checks – there should be no uncommitted changes and the project should depend on no SNAPSHOT dependencies change the version of the project in the pom file to a full release number (remove SNAPSHOT suffix) – in our example – 0.0.1 run the project test suites commit and push the changes create the tag out of this non-SNAPSHOT versioned code increase the version of the project in the pom – in our example – 0.0.2-SNAPSHOT commit and push the changes

mvn release:perform

The latter part of the Release process is Performing the Release; this will: checkout release tag from SCM build and deploy released code This second step of the process relies on the output of the Prepare step – the release.properties.