Here we describe all the ceremonial stuff necessary to publish a Java library to Maven Central.
This guide is based on Working with PGP Signatures and OpenPGP Best Practices.
Real name: the secureCodeBox authors
Email: securecodebox@iteratec.com
Comment: Maven Release Signing Key
Fingerprint: 40AA7D29EB6DE0667D7E723ADE4725604A739BAF
Password: [see our password manager]
We create a new GPG key with:
gpg --full-generate-key
Download private key from 1Password and import it locally
gpg --import private.key
gpg --armor --export-secret-keys 40AA7D29EB6DE0667D7E723ADE4725604A739BAF
gpg -o private.key --export-secret-key 40AA7D29EB6DE0667D7E723ADE4725604A739BAF
It is recommended to use an expiration date less than two years. We use an interval of two years. This means that we need to extend the expiration date every two years!
- Download the private key file
private.key
from 1Password - Import it locally:
gpg --import private.key
- Select the key :
gpg --edit-key 40AA7D29EB6DE0667D7E723ADE4725604A739BAF
- Now select the subkey and set the expire date (use
2y
for two years):
gpg> key 1
gpg> expire
- Save it:
gpg> save
- Update the private key in out password manager and GitHub Secrets
- How to remember the expirationd date over time & with changing developers?
- Do we need to import the public key in sonatype?