Renew Expired GPG Keys for Maven Deployments with Spring Boot
This guide walks through diagnosing GPG signing failures caused by expired keys during a swagger‑spring‑boot‑starter release, shows how to inspect the current keyring, edit the key, extend its validity, and finally re‑run Maven deploy to publish artifacts.
While publishing a project that uses swagger-spring-boot-starter, a GPG signing error occurs because the signing key has expired. The console shows warnings such as:
*gpg: WARNING: "--no-use-agent" is an obsolete option - it has no effect
gpg: no default secret key: No secret key
gpg: signing failed: No secret keyFirst, check the current keyring to confirm the key status: $ gpg --list-keys The output reveals that the primary RSA2048 key created in 2017 expired in December 2019, and the associated subkey is also expired.
Step 1: Edit the expired key $ gpg --edit-key xxxxxxxxxxxxxxx After entering the edit mode, the key information is displayed, confirming the expiration dates.
Step 2: Extend the expiration date
gpg> expire
# Choose the new validity period (e.g., 0 for never expires)
# Confirm the change with yThe command updates both the primary key and the subkey to “never expires”. The updated key details now show:
sec rsa2048/aaaaaaaaaaaaaaaa
created: 2017-12-05 expires: never usage: SC
ssb rsa2048/bbbbbbbbbbbbbbbb
created: 2017-12-05 expires: never usage: EFinally, save the changes: gpg> save With the renewed key, the Maven deploy command can be executed again to publish the artifact to the central repository.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
