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

时间:2018-11-02 11:04:13

标签: java windows maven deployment gnupg

我在Linux中使用maven-gpg-plugin可以,我可以安装gpg2进行签名,但是在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

1 个答案:

答案 0 :(得分:1)

在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>