Keir Nellyer
Keir Nellyer

Reputation: 923

'gpg.exe' is not recognized as an internal or external command, operable program or batch file - Maven Release Plugin

I just got my free Sonatype Maven repo and have been attempting to do a release. However whilst trying to do this I get an error when maven-gpg-plugin attempts to sign artifacts.

I get a ton of asterisks showing beforehand and I just press enter and then I get this issue, here's my full log: http://pastebin.com/GkLbFgBF

Here are the command line parameters I am attempting to use clean install javadoc:javadoc javadoc:jar source:jar release:clean release:prepare release:perform

I installed gpg4win thinking that might solve this but it hasn't.

Upvotes: 8

Views: 33235

Answers (3)

AJ Bishop
AJ Bishop

Reputation: 11

A quick and easy fix (at least for me) was to just copy the gnupg using the File Explorer interface from whatever folder it got saved to when you originally downloaded it. Then make sure it's pasted into both Program Files (x86) and Program Files folders in c: or Windows(c:)

I was getting the gpg is not recognized as an internal or external command error during a Linux Mint authentication check. Checked the PATH saw that C:\*AnyDirectory*\gnupg\bin was absent. Went to my c: folder in File Explorer and searched gnupg saw that it was in Program Files but not in Program Files (x86) fixed that now I get C:\Program Files (x86)\gnupg\bin in my PATH and the error message went away.

Upvotes: 1

Slawomir Jaranowski
Slawomir Jaranowski

Reputation: 8527

You can also use another plugin https://www.simplify4u.org/sign-maven-plugin/ for signing artifacts.

sign-maven-plugin does not use gpg for signing, it use java BouncyCastle for signing artifacts so you need not install gpg executable and plugin works on any operating system without special configuration.

Upvotes: 0

Nahush
Nahush

Reputation: 541

As each system is differently configured the following steps works in some cases.

when you receive this error message, “gpg is not recognized as an internal or external command” then you need to update your PATH variable.

To do this without reboot:

  1. Open up a command prompt window
  2. Paste this in:

    SET PATH=%PATH%;C:\Program Files (x86)\GNU\GnuPG
    
  3. Hit Enter

Upvotes: 13

Related Questions