Skip to content

fix: use MAVEN_GPG_PASSPHRASE env var instead of -Dgpg.passphrase CLI arg - #9

Merged
dkropachev merged 1 commit into
masterfrom
fix/maven-gpg-passphrase-env-var
Apr 1, 2026
Merged

fix: use MAVEN_GPG_PASSPHRASE env var instead of -Dgpg.passphrase CLI arg#9
dkropachev merged 1 commit into
masterfrom
fix/maven-gpg-passphrase-env-var

Conversation

@nikagra

@nikagra nikagra commented Apr 1, 2026

Copy link
Copy Markdown

Summary

Eliminates the deprecation warning produced by maven-gpg-plugin 3.x when passing the GPG passphrase via -Dgpg.passphrase:

[WARNING] Parameter 'passphrase' (user property 'gpg.passphrase') is deprecated:
Do not use this configuration, it may leak sensitive information.
Rely on gpg-agent or env variables instead.
...
MAVEN_GPG_PASSPHRASE environment variable for batch mode.

maven-gpg-plugin 3.x natively reads MAVEN_GPG_PASSPHRASE from the environment and treats the CLI property as a security risk. The forked Maven subprocess spawned by release:perform inherits the environment, so no explicit forwarding via <arguments> in pom.xml is needed.

Changes

  • Makefile: remove -Dgpg.passphrase=... from release:prepare and release:perform recipes; rename the env var guard from GPG_PASSPHRASE to MAVEN_GPG_PASSPHRASE
  • pom.xml: remove <gpg.passphrase /> property declaration; drop -Dgpg.passphrase=${gpg.passphrase} from maven-release-plugin <arguments> (the forked subprocess picks up MAVEN_GPG_PASSPHRASE from the environment automatically)
  • .github/workflows/release.yml: rename GPG_PASSPHRASE step env var to MAVEN_GPG_PASSPHRASE in all three release steps (Prepare release, Perform release, Perform dry release); the GitHub Actions secret name (GPG_PASSPHRASE) is unchanged

… 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
nikagra force-pushed the fix/maven-gpg-passphrase-env-var branch from 6adfa94 to e8b6aec Compare April 1, 2026 20:59
@nikagra
nikagra requested a review from Copilot April 1, 2026 21:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.passphrase property and stops forwarding -Dgpg.passphrase=... via maven-release-plugin arguments.
  • Updates Makefile release targets to require MAVEN_GPG_PASSPHRASE and removes -Dgpg.passphrase from release:prepare / release:perform.
  • Updates the GitHub Actions release workflow to set MAVEN_GPG_PASSPHRASE for 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
dkropachev merged commit fd9ad11 into master Apr 1, 2026
5 checks passed
@dkropachev
dkropachev deleted the fix/maven-gpg-passphrase-env-var branch April 1, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants