For a comprehensive manual how to manage Codehaus deployments see Performing a Release.
For your own security, using
--batch-mode is not really recommended since you have to enter your GPG passphrase in clear text on the command line, which could be saved for example in .bash_history. Rather wait and enter this passphrase as soon as Maven requests it on the command line input.
As an example, we will consider the release of version 5.20.0-rc2.
Do a dry run
mvn -Dtag=izpack-5.0.0-rc2 release:prepare [--batch-mode] -DdryRun=true \ -DdevelopmentVersion-DreleaseVersion=5.20.10-SNAPSHOT \ -DreleaseVersionrc2 -DdevelopmentVersion=5.20.0 \ -DpreparationGoals='clean verify install' \ -Dusername=your_codehaus_login
Build locally and prepare the staging repository at Codehaus Nexus:
mvn release:clean mvn release:prepare [--batch-mode] \ -DdevelopmentVersion=5.2.1-SNAPSHOT \ -DreleaseVersion=5.2.0 \ -DpreparationGoals='clean verify install' \ -Dusername=your_codehaus_login-Dtag=izpack-5.0.0-rc2 release:prepare -DreleaseVersion=5.0.0-rc2 -DdevelopmentVersion=5.0.0-rc3-SNAPSHOT -Dusername=<your_codehaus_login> mvn release:perform -Dusername=your_codehaus_login
git push origin master git push --tags
and to Codehaus (provided a remote codehaus initialized to ssh://firstname.lastname@example.org/izpack.git):
#git remote add codehaus ssh://email@example.com/izpack.git git push codehaus master git push --tags codehaus master
Close, promote and release from the staging repository at Codehaus Nexus:
Log in at Codehaus Nexus Staging Repositories, check the staging repository and if everything is fine, close Close and release Release it (in this order).
- You won't be able to perform release:prepare without having the HTTP credentials set in settings.xml, to be able to upload files to the staging storage at Codehaus Nexus
- You won't be able to close a Nexus staging repository without having your GPG key exported to a key server.
- Things work better if your local account name matches the one at Codehaus, and you don't have to specify the username parameter. Otherwise, things may break, especially the Git pushes.
Recovering from Failed Releases
There are several states you may get in after the release process described above fails:
Recover the staging repository:
Log in at Codehaus Nexus Staging Repositories, select the the staging repository entry which failed and drop it.
Reset the local git repository to the state before releasing:
First remove the additional files generated by the release plugin:
git log get the latest commit before the auto-generated commit of the release plugin follow, for example:
commit 49a769a0eefa7476d5ccc3849692ffe7b6e5ed2e Merge: d682c30 3218c81 Author: René Krell <firstname.lastname@example.org> Date: Tue Oct 15 09:45:05 2013 -0700 Merge pull request #143 from rkrell/IZPACK-993 [IZPACK-993] Dynamic variables - add configuration attribute to control whether to escape backslashes when reading from option and INI files
Now you can reset the local repository to the original state (or using FETCH_HEAD if the remote repository is still blocked and unchanged).
git reset --hard 49a769a0eefa7476d5ccc3849692ffe7b6e5ed2e
Check whether the release plugin has already tagged the target version using
git tag. If yes, delete the tag to avoid
release:perform from failing:
git tag --delete izpack-5.0.0-rc1
Now you can repeat the release process from the beginning.
Post-processing and Announcing Releases
- Use WebDAV at https://dav.codehaus.org/dist/izpack/ to push releases from the Maven repository
- Use the following channels for announcements:
Website izpack.org: https://github.com/izpack/izpack.github.com, automatically deployed to http://izpack.org
Blog news.izpack.org: Register and post an announcement. This is automatically forwarded to Twitter and Facebook.
Mailing list: email@example.com, firstname.lastname@example.org
Google+ group IzPack (in case you're a maintainer): https://plus.google.com/105618715093492300071/posts
IzPack.org website: https://github.com/izpack/izpack.github.com, automatically deployed to http://izpack.org
Twitter (ping @jponge): @izpack