jenkins之在Jenkins下运行时,maven-gpg-plugin失败,出现 “Inappropriate ioctl for device”
当Jenkins在远程Linux Shell中触发maven-gpg-plugin时,它将失败并显示gpg: signing failed: Inappropriate ioctl for device。这一直有效直到最近。我不知道发生了什么变化。
我在网上找到了很多建议使用export GPG_TTY=$(tty)的引用文献,但这不适用于ssh连接,因为tty是null。有任何想法吗?
请您参考如下方法:
我在https://myshittycode.com/2017/08/07/maven-gpg-plugin-prevent-signing-prompt-or-gpg-signing-failed-no-such-file-or-directory-error/上找到了很好的解释
如果页面出现问题,我将重新发布帖子的要点:
If you 1) initially had it working in the past, and 2) have tried all sorts of solutions from the web, and still couldn’t get it working, chances are you have unconsciously upgraded GPG version from 2.0 to 2.1.
听起来不错...
To fix this, GPG 2.1 requires --pinentry-mode to be set to loopback in order to pick up gpg.passphrase value defined in Maven settings.xml.
So, update Maven GPG Plugin configuration in pom.xml to the following:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。



