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 github login information in your
~/.m2/settings.xml
. Something like:
<profile>
<id>github</id>
<properties>
<github.global.userName>username</github.global.userName>
<github.global.password>password</github.global.password>
</properties>
</profile>
- 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 if required)
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!
The mvn release plugin will have automatically updated the project version and committed and pushed to origin