To release a new version, you need manually publish it to maven repository (Maven Central). This requires the following steps:
- Set up and configure GPG key for generating a signature. See this guide
for more information.
- Install GnuPG or jump to the next point.
- Using
gpg --list-signatures
check if you have a key. If not, generate one usinggpg --gen-key
. - During creation process, you will need to create a passphrase. This passphrase and your private key are all that is needed to sign artifacts with your signature.
- Don't forget to add your public key to the key server so that others can verify your signature.
- Set environment variable
GPG_TTY
:export GPG_TTY=$(tty)
- Configure account details to deploy to OSSRH
- Find the configuration file for Maven -
settings.xml
file. It is located either in~/.m2/settings.xml
(single user configuration) or in/opt/homebrew/Cellar/maven/[version]/libexec/conf
(configuration for all Maven users on a machine). - Add the pb Jira Sonatype account credentials to the
settings.xml
:
<settings> <servers> <server> <id>ossrh</id> <username>Engineering</username> <password>[password from 1Password - look for "Stargate Sonatype" item]</password> </server> </servers> </settings>
- Add GPG passphrase to the
settings.xml
:
<settings> <profiles> <profile> <id>ossrh</id> <properties> <gpg.passphrase>[passphrase]</gpg.passphrase> </properties> </profile> </profiles> </settings>
- Find the configuration file for Maven -
- And finally publish the new version:
mvn clean deploy
- Check that new version is available in Maven central (publishing may take a few minutes).
Follow this guide for more information.