I always seem to forget how to go about this, so here tis all documented. The official guide has more.
Ensure GPG is installed and that your key details are in ~/.gnugpg
You'll also need to make sure that you have configured your sonatype
login information in your ~/.m2/settings.xml
. Something like:
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>sonatype-username</username>
<password>sonatype-password</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
<username>sonatype-username</username>
<password>sonatype-password</password>
</server>
</servers>
- Ensure library version is set to the version you want to release, appended with "-SNAPSHOT"
- In Changelog at bottom of README:
- Add what was changed since the last release
- Change name of
Development version
toRelease <version> on <date>
- Add new empty
Development version <next-version>-SNAPSHOT (current Git
master`)
- Change current version in Installation area
- commit to master as "for release" or something
mvn clean deploy
(enter GPG passphrase)
mvn release:clean
mvn release:prepare
mvn release:perform
- Navigate to the sonatype staging repositories
- Login using your credentials
- Go to Staging Repositories page.
- Select a staging repository (memoocar)
- Click the Close button (with any reason, e.g "release")
- You might have to refresh to see the change
- Select and click release. Done!
git push