Useful Sonatype Links
For lack of a better place at this time, here's some useful pages on Sonatype which detail the Sonatype Maven Release Process:
Release Numbering Convention
As agreed by the Steering Group, VIVO follows the Semantic Versioning guidelines - http://semver.org/
- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards-compatible manner, and
- PATCH version when you make backwards-compatible bug fixes.
Prerequisites
Verify Release Priveleges
To perform a release, you must have all of the following:
- Write access to the Vitro and VIVO GitHub repositories hosted at GitHub
- Write access to the org.vivoweb groupId in the snapshot and staging repositories hosted at oss.sonatype.org. If you don't already have this, you will need to:
- Sign up for a Sonatype JIRA account. This account will also serve as your login to the Sonatype OSS system. (If you already have a Sonatype account, you can skip this step)
- Ask a Committer with release privileges (e.g. a previous release manager) to request that your Sonatype account be given release privileges to the "org.vivoweb" GroupID. This request should be submitted via the Sonatype JIRA system in the Open Source Project Repository Hosting project.
- Once Sonatype gives you the proper authorization, you should be able to login to the Sonatype OSS system using the same login/password you setup in Sonatype JIRA. You should also have access to publish new releases to the "org.vivoweb" GroupID.
- NOTE: The full details of signing up and getting access to Sonatype are also posted online here: Sonatype Maven Repository Usage Guide
- You must generate and publish your own personal Code Signing Key (required by Sonatype). Here are two sites that give hints on how to do that:
- Creating a Code Signing Key
- How to Generate PGP Signatures with Maven (required for all Sonatype releases)
- Make sure to publish your Key file to
hkp://pgp.mit.edu
, as this is the Key Server Sonatype uses for verification:- (e.g.)
gpg --keyserver hkp://pgp.mit.edu --send-keys [yourKeyID]
[yourKeyId]
can be found by running the following command and copying the alpha-numeric string after the "/" on the "pub" linegpg --list-keys
- You can see if your key is already on that Key Server by visiting http://pgp.mit.edu and searching on your name
- (e.g.)
Update Maven settings.xml
Vitro and VIVO root pom.xml already has the correct staging and snapshot repositories listed in the OSS parent's '<distributionManagement>' section. In order to deploy, you will need to add your Sonatype OSS username and password to your local ~/.m2/settings.xml
file. For example:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <profiles> <id>ossrh</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <gpg.keyname>YourKeyName</gpg.keyname> <gpg.passphrase>YourKeyPassphrase</gpg.passphrase> <gpg.defaultKeyring>false</gpg.defaultKeyring> <gpg.useagent>true</gpg.useagent> <gpg.lockmode>never</gpg.lockmode> <gpg.homedir>YourGPGDir</gpg.homedir> <gpg.publicKeyring>YourGPGDir/pubring.gpg</gpg.publicKeyring> <gpg.secretKeyring>YourGPGDir/secring.gpg</gpg.secretKeyring> </properties> </profiles> <servers> <!--Login info for Sonatype SnapShot repository--> <server> <id>ossrh</id> <username>YourSonatypeUsername</username> <password>YourSonatypePassword</password> </server> </servers> </settings>
If you don't yet have a ~/.m2/settings.xml
file, you should create one, and copy the full contents above (obviously make sure to put in your username and password, and GPG details).
Making a Snapshot Release (e.g. 'vivo-x.y.z-SNAPSHOT')
One Step Process
From a clean, up-to-date copy of develop/branch, run the following command:
mvn clean deploy -Prelease
If you run this from the Vitro directory, it will only release the Vitro artefacts. If you release from VIVO - and have the Vitro checkout alongside - it will release artefacts from BOTH projects.
The snapshot will be immediately available in the public Sonatype repository: http://oss.sonatype.org/content/groups/public
Making an Official Release (e.g. 'vivo-x.y.z' or 'vivo-x.y.z-rc1')
Setting The Version Numbers
In order to update the version number, you can run the following command:
- mvn versions:set
And enter the new version number - e.g. 1.9.0-rc1. You MUST do this - and use the same version number - in all of the following locations:
- /Vitro
- /Vitro/installer
- /VIVO
- /VIVO/installer
The reason that you have to update Vitro and VIVO, and the installer projects separately, is because each of them are "roots" of multi module projects (the installer is a "root" because it can be distributed and used separately, and if it chained into the top level projects, would cause the release process to fail).
Release The Project
With the version numbers set, you can run the following command:
mvn clean deploy -Prelease
Like above, if you run this from VIVO, and have the Vitro project next to it, then this will release all the artefacts in one go. Otherwise, you have to do Vitro and the VIVO.
Once the command completes successfully, you need to log in to the Sonatype server to check the uploaded files and to deploy them to Maven central