This repository has been archived by the owner on Jul 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Releasing
Christian Kaltepoth edited this page Dec 1, 2019
·
2 revisions
Before doing a release, you should run this to verify your setup and that the build works correctly:
mvn -Prelease -Dgpg.executable=gpg2 clean install
First define two environment variables. This will allow you to copy & paste the following commands:
export RELEASE_VERSION="1.0.0-RC1"
export DEVELOP_VERSION="1.0.0-SNAPSHOT"
The release should be performed on a separate branch:
git checkout -b release master
Now update the relevant versions in the pom.xml:
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${RELEASE_VERSION}
cd sample
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${RELEASE_VERSION}
cd -
Then commit the changes and tag the result:
git commit -am "Preparing ${RELEASE_VERSION} release"
git tag -a -m "${RELEASE_VERSION}" ${RELEASE_VERSION}
Initialize the gpg agent so you won't get asked for the password during the build:
echo "Foobar" | gpg2 --clear-sign
Perform the release:
mvn -Prelease -Dgpg.executable=gpg2 clean deploy
Log into Sonatype OSS, then "close" and "release" the staging repository.
The next step is to update the version for the next development iteration:
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${DEVELOP_VERSION}
cd sample
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${DEVELOP_VERSION}
cd -
git commit -am "Preparing for next development iteration"
Merge everything to master:
git checkout master
git merge release
git branch -d release
Then push your changes:
git push --follow-tags
You are done!