9C3.Manage OSSRH
OriginalPracticeGpgLess than 1 minute
9C3.Manage OSSRH
Wings use Sonatype OSSRH
9C3.1.Manage GPG
The key used for gpg signature is valid for 1 year by default. The expired key will give "skipped Unusable secret key" error when deploy.
mykey=541B1728468267BFA83FE092CE8F6F63A835DB68
# list all secret keys
gpg --list-secret-keys
# Edit expiration
gpg --edit-key $mykey
>expire
>1y
>save
# Publish to public, without specifying --keyserver
gpg --keyserver keyserver.ubuntu.com --send-keys $mykey
# Backup secret key, need to enter password
# password in ~/.m2/settings.xml gpg.passphrase
gpg --export-secret-keys --armor $mykey
Maven section (.m2/settings.xml)
<servers>
<server>
<id>ossrh</id>
<username>trydofor</username>
<password>Yt....</password>
</server>
</servers>
<profile>
<id>ossrh</id>
<properties>
<gpg.keyname>54....</gpg.keyname>
<!-- GPG should prompt for passphrase if not provided -->
<gpg.passphrase>f....</gpg.passphrase>
<gpg.executable>gpg</gpg.executable>
<gpg.skip>false</gpg.skip>
</properties>
</profile>