-
Delete the release descriptor (release.properties)
-
Delete any backup POM files
mvn release:clean
-
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.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.2-SNAPSHOT
-
Commit and push the changes
Allows you to run all operations in release:prepare
goal except for actual commits into SCM.
mvn release:prepare -DdryRun=true
-
Checkout release tag from SCM
-
Build and deploy released code
-
Relies on the output of the Prepare step – the
release.properties
.
mvn release:prepare
Create maven2 hosted repository in Nexus, for us it's api-release
curl -v --user admin:admin123 --upload-file <filename> http://localhost:8081/repository/<repository-name>/<filename>
Configure the credentials for the nexus-releases server in the global settings.xml
(%USER_HOME%/.m2/settings.xml):
<servers>
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
mvn release:clean release:prepare release:perform -DreleaseVersion=0.1 -DdevelopmentVersion=0.2-SNAPSHOT
Reference: http://www.baeldung.com/maven-release-nexus