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

15,252

Solution 1

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

Solution 2

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.

Share:
15,252
Keir Nellyer
Author by

Keir Nellyer

Updated on June 08, 2022

Comments

  • Keir Nellyer
    Keir Nellyer about 2 years

    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.

  • Keir Nellyer
    Keir Nellyer almost 9 years
    Thanks :) managed to figure this out awhile back but forgot to update this question (sorry). But others may benefit from this!