fix: use MAVEN_GPG_PASSPHRASE env var instead of -Dgpg.passphrase CLI arg - #9
Merged
Merged
Conversation
… arg maven-gpg-plugin 3.x natively reads the MAVEN_GPG_PASSPHRASE environment variable and explicitly deprecates the gpg.passphrase property/CLI flag as a potential secret leak vector. - Makefile: remove -Dgpg.passphrase from release:prepare and release:perform; rename the guard check from GPG_PASSPHRASE to MAVEN_GPG_PASSPHRASE - pom.xml: remove <gpg.passphrase /> property and drop -Dgpg.passphrase from maven-release-plugin <arguments> (forked subprocess inherits the env var) - release.yml: rename GPG_PASSPHRASE step env var to MAVEN_GPG_PASSPHRASE in all three release steps
nikagra
force-pushed
the
fix/maven-gpg-passphrase-env-var
branch
from
April 1, 2026 20:59
6adfa94 to
e8b6aec
Compare
There was a problem hiding this comment.
Pull request overview
Updates the release tooling to avoid passing the GPG passphrase via the deprecated -Dgpg.passphrase Maven CLI property, relying instead on maven-gpg-plugin’s MAVEN_GPG_PASSPHRASE environment variable support.
Changes:
- Removes the
gpg.passphraseproperty and stops forwarding-Dgpg.passphrase=...viamaven-release-pluginarguments. - Updates Makefile release targets to require
MAVEN_GPG_PASSPHRASEand removes-Dgpg.passphrasefromrelease:prepare/release:perform. - Updates the GitHub Actions release workflow to set
MAVEN_GPG_PASSPHRASEfor release steps (keeping the secret name unchanged).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pom.xml |
Drops deprecated gpg.passphrase plumbing from properties and maven-release-plugin arguments. |
Makefile |
Switches passphrase guard and release invocations from GPG_PASSPHRASE/-Dgpg.passphrase to MAVEN_GPG_PASSPHRASE env usage. |
.github/workflows/release.yml |
Sets MAVEN_GPG_PASSPHRASE in release steps to align CI with the updated release mechanism. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dkropachev
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Eliminates the deprecation warning produced by
maven-gpg-plugin3.x when passing the GPG passphrase via-Dgpg.passphrase:maven-gpg-plugin3.x natively readsMAVEN_GPG_PASSPHRASEfrom the environment and treats the CLI property as a security risk. The forked Maven subprocess spawned byrelease:performinherits the environment, so no explicit forwarding via<arguments>inpom.xmlis needed.Changes
Makefile: remove-Dgpg.passphrase=...fromrelease:prepareandrelease:performrecipes; rename the env var guard fromGPG_PASSPHRASEtoMAVEN_GPG_PASSPHRASEpom.xml: remove<gpg.passphrase />property declaration; drop-Dgpg.passphrase=${gpg.passphrase}frommaven-release-plugin<arguments>(the forked subprocess picks upMAVEN_GPG_PASSPHRASEfrom the environment automatically).github/workflows/release.yml: renameGPG_PASSPHRASEstep env var toMAVEN_GPG_PASSPHRASEin all three release steps (Prepare release,Perform release,Perform dry release); the GitHub Actions secret name (GPG_PASSPHRASE) is unchanged