apache / apache/maven-gpg-plugin

"Could not determine gpg version"

Open
#137 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
31
Forks
27
Avg merge
4h 44m
Merged PRs (30d)
4

Description

### Affected version

3.2.6

### Bug description

I am setting up central publishing with maven and have added this maven plugin.
```

org.apache.maven.plugins
maven-gpg-plugin
3.2.6


sign-artifacts
verify

sign


```

upon trying to deploy i receive this error message
"Could not determine gpg version"

I traced this back to [this line of the plugin](https://github.com/apache/maven-gpg-plugin/blob/master/src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java#L74)

After reviewing the regex that is used to get the version `Pattern.compile("gpg \\([^)]+\\) .+");`
And then the regex used to match the value `VERSION_PATTERN = Pattern.compile("(\\d+\\.)+(\\d+)")`

And reviewing my terminal's `gpg --version` call
```
C:\Users\MY_USERNAME>gpg.exe --version
gpg (GnuPG) 2.4.8
libgcrypt 1.11.1
Copyright (C) 2025 g10 Code GmbH
License GNU GPL-3.0-or-later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: C:\Users\MY_USERNAME\AppData\Roaming\gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
```

I don't see why this failure has occurred in my build. Any help would be appreciated.

My gpg came from [gpg4win.org](https://gpg4win.org/download.html) as referenced by [gnupg.org](https://www.gnupg.org/download/)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java at the version-detection logic and compare its patterns with the reported Windows gpg --version output. Verify how the command output is parsed, then confirm that GnuPG 2.4.8 is detected and signing proceeds without the “Could not determine gpg version” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.