Skip to content

Releasing Components

sanjay-saxena edited this page Nov 9, 2015 · 18 revisions

Releasing Components to Maven Central

Follow this guide if you would like to release components to Maven Central.

Registering with Sonatype

Sonatype is intermediate repository and 3rd party on which releases are staged and eventually picked up from maven central.

  1. Sign up for an account
  2. Contact an existing team member (@dpwspoon) asking them to give your account permissions to release under the "org.kaazing" groupId.

Setting up your local environment

Enable code signing on your local system as documented on Sonatype. Specifically this involves:

  • Installing GPG: Mac OSX users should use the MacGPG installer from gpgtools project instead of GnuPG installer.
  • Generating and Distributing Public Key
    • Generate a Key Pair: gpg --gen-key
    • List Your Public-Key: gpg2 --list-keys
    • Distribute Your Public-Key: gpg2 --keyserver hkp://pool.sks-keyservers.net --send-keys <key>
  • Configuring GPG in Maven's settings.xml as shown below.
<profile>
    <id>ossrh</id>
    <activation>
        <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
        <gpg.executable>gpg2</gpg.executable>
        <gpg.passphrase>super_secret_password</gpg.passphrase>
    </properties>
</profile>
  1. Add osshr as a server in your settings.xml. An example is below
<settings>
  <servers>
    <server>
      <id>ossrh</id>
      <username>your-sonatype-id</username>
      <password>your-sonatype-pwd</password>
    </server>
  </servers>
</settings>

See encrypting passwords in settings.xml

Performing a release

Kaazing uses gitflow for its version control and branching model. To perform a release install the latest version of the gitflow plugin.

Performing a release from develop

The following lists and describes the steps of releasing a component "widget" with version "1.0"

Checkout locally and get relevant branches

git clone https://github.com/kaazing/widget;
cd widget;
git checkout master; git checkout develop;

Initialize git settings

git flow init -d

Start release process

git flow release start 1.0

Set version number

mvn versions:set -DgenerateBackupPoms=false -DnewVersion=1.0
git commit -a -m "Prepare release 1.0"
# now merge version number commit to develop
git checkout develop
git merge -s ours release/1.0
git commit

For long lived release branches that are not going to be released to maven central ASAP do the following

git push origin develop
git checkout release/1.0
git push origin release/1.0

Perform a release to staging repository

git checkout release/1.0
mvn clean deploy -U -Prelease

Note, if the release fails you are more than welcome to make fixes on the release branch! Those changes will get merged back to develop when closing the release. Then simply rerun the command.

At this point, the repo will be automatically staged and released. This can be confirmed by checking for the repo by loading this page in the browser. Once confirmed, the release branch must be closed!.

Here are the steps to close the release branch:

git push origin release/1.0
git flow release finish -p 1.0 -m "1.0"

Performing a hotfix release

TODO