Deploying IzPack Versions to Public Repositories
General Requirements
- You need to import the Sonatype OSS CA certificate to your local JDK.
- You must be an IzPack developer at Github.
- You need a GnuPG public key.
Info |
---|
Use JDK 1.6 8 for compatibility reasons to deploy of snapshots and releases! |
Create and Export a GnuPG Key
Your public key must be added to the KEYS file in the source code parent directory:
...
For more information on how to create and distribute GPG keys, look at the GNU Privacy Handbook.
Configure Sonatype Nexus credentials
Sonatype Nexus requires authentication usign the following convention in your $M2_HOME/settings.xml:
...
For information on how to encrypt your personal password see the Maven documentation.
Install the Sonatype OSS CA Certificate into the Java JDK
For deployments you need to add the oss.sonatype.org certificate to the list of accepted certificates of your JDK.
...
Code Block | ||||
---|---|---|---|---|
| ||||
export MAVEN_OPTS="-Djavax.net.ssl.keyStore=$HOME/.keystore \ -Djavax.net.ssl.keyStorePassword=<your_keystore_pwd> \ -Djavax.net.ssl.trustStore=$HOME/.keystore \ -Djavax.net.ssl.trustStorePassword=<your_truststore_pwd" |
Deploying IzPack Snapshots
Any IzPack developer is encouraged to publish new -SNAPSHOT versions as they publish changes to the Codehaus Git repository. Public snapshot deployments can be done each time by a developer provided the code passes automatic tests (do not skip tests before deploying).
...
No Format |
---|
mvn clean verify deploy |
Deploying IzPack Releases
Warning |
---|
Before releasing, ask the fellow developers whether they agree! |
...
As an example, we will consider the release of version 5.2.24.
Do a dry run
No Format |
---|
mvn -DperformRelease=true -Dtag=izpack-5.2.24 release:prepare -DdryRun=true -DreleaseVersion=5.2.24 -DdevelopmentVersion=5.2.35-SNAPSHOT |
Release!
Build locally and prepare the staging repository at Sonatype Nexus:
Please note that some child modules are excluded from the build per profile buildDLL. The Maven Release Plugin will not update their project versions in the POM. Therefore it is necessary to explicitly run the versions-maven-plugin to fix them.
Code Block | ||
---|---|---|
| ||
export JAVA_HOME=/usr/java/jdk1.8.xx export RELEASE_VERSION=5.2.24 export DEVELOPMENT_VERSION=5.2.35-SNAPSHOT # Preparing the release mvn release:clean mvn -Dtag=izpack-${RELEASE_VERSION} -DreleaseVersion=${RELEASE_VERSION} -DdevelopmentVersion=${DEVELOPMENT_VERSION} release:prepare # Fixing the versions of the native child modules not deployed by default mvn -N org.codehaus.mojo:versions-maven-plugin:2.2:update-child-modules -DnewVersion=${DEVELOPMENT_VERSION} git add -u git commit --amend --no-edit git push mvn org.codehaus.mojo:versions-maven-plugin:2.2:commit # Perform the release # Check your HTTP proxy settings in settings.xml and whether the proxy is reachable (required for deployments to the staging repo) mvn -DperformRelease=true release:perform rm izpack-native-parent/*/pom.xml.versionsBackup |
...
won't have any effect, the remote repository will be already up to date at this stage
Close, promote and release from the staging repository at Sonatype Nexus:
Follow the instructions described in Releasing the Deployment.
...
You may not 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 Sonatype OSS Nexus
You may not 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 Sonatype, and you don't have to specify the username parameter. Otherwise, things may break, especially the Git pushes.
Recovering from Failed Releases
Recover the GIT repository
To undo a failed release, clean up untracked files by issuing:
...
Say our project was at version 5.2.24-SNAPSHOT. Preparing a release will remove the -SNAPSHOT suffix, commit and tag the code on Github, then update the project version to 5.2.34-SNAPSHOT.
If you need to undo the release, revert the changes with
git reset --hard HEAD~2
and delete the tag with
git tag git tag --delete izpack-5.2.24
followed by
git push origin :refs/tags/izpack-5.2.24
The remote repository is resynchronized by:
git push --force
Recover the staging repository
Log in to OSSRH available at https://oss.sonatype.org/, select the the staging repository entry which failed and drop it.
Post-processing and Announcing Releases
Use the following channels for announcements:
- Website izpack.org: https://github.com/izpack/izpack.github.comio, automatically deployed to http://izpack.org
- Blog news.izpack.org: Register and post an announcement. The new post should be directly shared from Blogger to
- Mailing list: izpack-announce@google-groupsannounce@googlegroups.com