Chapter 4. Release Procedure

This chapter describes details about the release procedure using Maven and following the git flow principles. The target audience are core developers with appropriate access rights.

First, start off with a new release branch and let Maven prepare the release for us Figure 4.1, “Prepare a release branch”.

         $ git checkout -b release/v{VERSION} devel
$ mvn release:prepare -Psign -Pproduction
      

Figure 4.1. Prepare a release branch


At this point, you should get the artifacts from the target directory for later publishing Figure 4.2, “Merge the changes to the devel branch”.

Never ever try to perform the release using the Maven release plugin. It cannot be configured to publish the artifacts and breaks the git-flow branching/tagging.

The rest is about getting git into a good shape. This starts by getting the updated pom.xml into the devel branch.

         $ git checkout devel
$ git merge --no-ff release/v{VERSION}
      

Figure 4.2. Merge the changes to the devel branch


We need to get the correct pom.xml to the master branch as well. For this, we will use the commit prior to the head in the release branch Figure 4.3, “Merge the changes to the master branch as well”.

         $ git checkout master
$ git merge --no-ff release/v{VERSION}~1
      

Figure 4.3. Merge the changes to the master branch as well


The last step is to clean everything up and go public Figure 4.4, “Merge the changes to the master branch as well”.

         $ git branch -D release/v{VERSION}
$ git push --all && git push --tags
      

Figure 4.4. Merge the changes to the master branch as well


Only users with an approved account in the Sonatype JIRA [3] can upload the artifacts. Then follow the rules specified in the Sonatype OSS Maven Repository Usage Guide [4] .