'gpg2' 未被识别为内部或外部命令

'gpg2' is not recognized as an internal or external command

我在 linux 中使用 maven-gpg-plugin 一切正常我可以安装 gpg2 for sign 但在 windows 中部署有问题。

有日志 'gpg2' is not recognized as an internal or external command, operable program or batch file.(与我得到的 gpg2 --version 相同)
并且
Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.5:sign (sign-artifacts) on project.

如何为 windows 安装 gpg2

在您的 settings.xml 文件中,更改 gpg.executable 属性。例子.

<profiles>
    <profile>
        <id>ossrh</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <gpg.executable>gpg</gpg.executable>
            <gpg.passphrase>PASSPHRASE</gpg.passphrase>
        </properties>
    </profile>
</profiles>