Skip to content
Alessio Palmero Aprosio edited this page Jan 3, 2018 · 6 revisions

How to release the utils package. We use the git-flow paradigm.

Check that the active branch is develop:

git status

You should see a text like this:

On branch develop
Your branch is up to date with 'origin/develop'.

nothing to commit, working tree clean

If not, run git checkout develop.

Find all references to SNAPSHOT dependencies in the code.

find . -name 'pom.xml' -exec cat {} \; | grep -C 1 SNAPSHOT

You should get only the lines related to the current project (main module and sub modules).

Set environment variables.

export THIS_VERSION=1.3.2
export NEXT_VERSION=1.4-SNAPSHOT

Check that everything compiles correctly.

mvn clean package install -DskipTests -Prelease

Create release branch.

git checkout -b release-$THIS_VERSION develop

This is the last opportunity to make changes before the release, therefore you should check carefully that everything works well. Finally, change the version in POMs.

mvn versions:set -DnewVersion=$THIS_VERSION
git commit -a -m "Release $THIS_VERSION"

You can double-check that there are no SNAPSHOT left: find . -name 'pom.xml' -exec cat {} \; | grep -C 1 SNAPSHOT. After that, deploy on Maven Central (see [here](see http://central.sonatype.org/pages/apache-maven.html)).

mvn clean package install -DskipTests
mvn clean deploy -DskipTests -Prelease

Release the source code.

git checkout master
git merge release-$THIS_VERSION
git push
git checkout develop
git merge release-$THIS_VERSION
git push
git branch -d release-$THIS_VERSION
git tag -a $THIS_VERSION -m "Version $THIS_VERSION" master
git push --tags

Go back to snapshot.

mvn versions:set -DnewVersion=$NEXT_VERSION
git commit -a -m "Ready for snapshot $NEXT_VERSION"
git push

Clone this wiki locally