This page will guide the development team with setting up their environment to perform a release.
- Install/Configure GPG – The artifacts that are deployed to the central maven repositories need to be signed. To do this you will need to have a public and private keypair. There is a very good guide that will walk you through this.
- JDK 1.8+ is installed on your command line path.
- Install Maven 3.2.5 or higher.
- git is installed on your command line path. For more information, please refer to the git website.
As of Maven 2.1.0 you can now encrypt your servers passwords. We highly recommend that you follow this guide to set your master password and use it to encrypt your Sonatype password in the next section.
Using the instructions from the previous step encrypt your Sonatype password and add the following servers to your ~/.m2/settings.xml file. You may already have other servers in this file. If not just create the file. You will need to change the username and password to your own.
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>bucko</username>
<password>{jXNVWnoPFTsHLpMvz5ZbIt9kRbzGpI8u+9EF1iFQyJQ=}</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
<username>bucko</username>
<password>{jXNVWnoPFTsHLpMvz5ZbIt9kRbzGpI8u+9EF1iFQyJQ=}</password>
</server>
</servers>
</settings>
The release plugin for maven is already configured in the stripes-guice pom file so all you need to do is execute the following two steps to complete the release. The first step will create the release tag and update the pom with the correct release and snapshot versions. The second step will sign and deploy the artifacts to the Sonatype open source repository. This repository is synced every hour to the central Maven repositories. If you don’t supply the optional gpg.passphrase then you will be prompted for it.
(Optional) Run a Prepare “dry run”
mvn -DdryRun=true release:prepare
mvn release:clean
Prepare the release
mvn release:prepare
Perform
mvn release:perform
After completing the release to the maven repository it is time to build the downloadable distributions (bz2, gz, and zip). From the root of the project you just released perform the following steps:
cd into the checkout directory in the maven target directory
cd target/checkout/
run the build.sh file or the following command this will build the distributions on the checked out version that was just released
mvn clean javadoc:javadoc assembly:assembly
once the build is complete you can cd into the target directory and find the three distribution files (stripes-guice.×.×.x.tar.bz2, stripes-guice.×.×.x.tar.gz, and stripes-guice.×.×.x.tar.zip).
cd target
you can upload the new distributions to the downloads section on github.
Actual preparation for setting up a Sonatype repository for syncing with the Maven Centeral repository. This has already been handled but it is good information in order to understand the bigger picture.