There is no need to configure the GPG Keys anymore. Simply create a new token on https://oss.sonatype.org/#profile;User%20Token.
Make sure maven looks like bellow
<?xml version="1.0" encoding="UTF-8" ?>
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<servers>
<server>
<id>ossrh</id>
<username>{{username}}</username>
<password>{{password}}</password>
</server>
</servers>
</settings>mvn clean deploy -PreleaseFor gradle.properties:
ossrhUsername=your-username
ossrhPassword=your-tokengradle clean build test
./gradlew publishMavenPublicationToOSSRHRepositoryDEPRECATED INFO
gradle clean build test
./gradlew publishMavenPublicationToOSSRHRepositoryThe rest manually in Nexus Sonatype.
This file is mandatory before a release:
gradle.properties:
ossrhUsername=<ossrhUsername>
ossrhPassword=<ossrhPassword>
signing.keyId=<signing.keyId>
signing.password=<signing.password>
signing.secretKeyRingFile=/Users/<user>/.gnupg/secring.gpgGenerate the signing fields(if not already available. check with gpg -K first!):
gpg --full-generate-key
gpg -K
gpg --keyring secring.gpg --export-secret-keys > ~/.gnupg/secring.gpg
gpg --keyserver keyserver.ubuntu.com --send-keys <KEY>gpg --full-generate-key- Key generationgpg -K- Lists keys. TheKeyIdis the last 8 Digits of the GPG keygpg --keyring secring.gpg --export-secret-keys > ~/.gnupg/secring.gpg- Exports the keys tosecring.gpggpg --keyserver keyserver.ubuntu.com --send-keys <KEY>- Exports the key so that Sonatype can verify the release
gpg --keyserver hkp://keyserver.ubuntu.com --send-keys <your GPG key>
gpg --list-keys
export GPG_TTY=$(tty)mvn clean deploy -Prelease
mvn nexus-staging:release -Prelease<?xml version="1.0" encoding="UTF-8" ?>
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.keyname>${{keyname}}</gpg.keyname>
<gpg.passphrase>{{password}}</gpg.passphrase>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>ossrh</activeProfile>
</activeProfiles>
<servers>
<server>
<id>ossrh</id>
<username>{{username}}</username>
<password>{{password}}</password>
</server>
</servers>
</settings>