How to release

This small tutorial contains necessary steps required to perform a release of Slice to newer version.

Generating PGP Signatures

Synchronization Slice artifacts with Maven central requires to provide pgp signatures. For that purpose you need to generate a key pair. If you don't generated and propagated public key yet, see Generating a PGP Signatures.

Configuring settings.xml file

To stage release, you'll need to enable connection with Sonatype OSSRH

Add server section below to your settings.xml file:

settings.xml
<settings>
	...
	<servers>
		<server>
			<id>sonatype-nexus-staging</id>	
			<username>your-jira-id</username>
			<password>your-jira-pwd</password>
		</server>
	</servers>
	...
</settings>

In case you don't already have Sonatype JIRA account and publish rights to Slice, firstly you'll need to create an account on https://issues.sonatype.org/.

After that to get write permission to Slice, you will need to ask for it by creating a JIRA ticket (you can take a looks at comments on this ticket).

 

The information about public key and scm username are also required and will need to add to chosen profile a path to the public key and scm.username file, e.g.:

settings.xml
<settings>
	...
	<profile>
		<id>slice-author</id>
		<activation>
			<activeByDefault>false</activeByDefault>
		</activation>
		<properties>
			<privateKey>C:\Users\kamil.ciecierski\.ssh\id_dsa.pub</privateKey>
			<scm.username>git</scm.username>
		</properties>
	</profile> 
	...
</settings>  

See also Sonatype Maven Repository Usage Guide

Staging release with Maven

Before preparing Maven project to release, make sure that:

  • you are switched to a proper git branch.
  • your git user settings are correct and local repository is synchronized with the remote one - otherwise do proper git-push or git-pull operation.
  • you generated and propagated PGP key - see Generating a PGP Signatures.

To start releasing process, type:

Console
mvn release:prepare

You will be prompted for the version number for each module of the project, tag name, and next SNAPSHOT versions. You will need also type the passphrase for the key, which you generated during Generating a PGP Signatures step. When this command finish successfully, the version section of each module's pom.xml file will be updated.

See also Maven Release Plugin documentation


Next, type in console:

Console
mvn release:perform

 You will also be prompted for GPG passphare and during this Maven will checkout the tag you just prepared, then build and deploy it into Nexus staging repository.

See also Sonatype Maven Repository Usage Guide

Releasing using Nexus

If staging release with Maven ended successfully, then:

  • go to Nexus UI: https://oss.sonatype.org/ and log in using Sonatype JIRA credentials.
  • go to Staging Repositories page and select a Slice staging repository (it should be at the end of the list, if there isn't, that means that Maven release performing process failed).
  • click the Close button, type closing description. If the staging repository is closed successfully, you will get a notification email and confirmation via the ui.
  • select a Slice staging repository again, click Release button, write releasing description.

If releasing ends successfully, the new versions of each module should be added here.

See also Sonatype Maven Repository Usage Guide