jenkins - 在 Jenkins 下运行时,maven-gpg-plugin 失败并显示“设备的 ioctl 不合适”
问题描述
当 Jenkinsmaven-gpg-plugin
在远程 Linux shell 中触发时,它会以gpg: signing failed: Inappropriate ioctl for device
. 直到最近,这一直有效。我不知道发生了什么变化。
我发现很多在线参考资料表明export GPG_TTY=$(tty)
,但这不适用于 sshtty
连接null
。有任何想法吗?
解决方案
如果页面出现故障,我将重新发布帖子的要点:
如果您 1) 最初让它在过去工作,并且 2) 尝试了来自网络的各种解决方案,但仍然无法使其工作,那么您可能已经无意识地将 GPG 版本从 2.0 升级到 2.1。
听起来很对...
为了解决这个问题,GPG 2.1 需要将 --pinentry-mode设置为loopback以获取 Maven settings.xml 中定义的 gpg.passphrase 值。
因此,将 pom.xml 中的 Maven GPG 插件配置更新为以下内容:
<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>
推荐阅读
- google-bigquery - 如何使用 WHERE NOT 过滤掉我的条件
- sql - 在 SQL 中进行多次更新的最高效方式
- c# - 它没有感应到我的 input.getaxis 是否有原因
- colors - 更改任务栏图标的颜色
- node.js - 尽管表单输入已成功传输到后端,为什么 JSON.parse(event.body) 返回 null?(包括代码和日志)
- asp.net-web-api - .Net Framework API 控制器无法识别路由属性
- javascript - 创建分层/缩进下拉列表
- php - 我正在尝试使用此表单来捕获用户详细信息并使用底部的 PHP 脚本将它们加载到 MySQL 表中,但它不起作用
- python - Ansible 是否公开其自动发现的 Python 解释器?
- spring - 如何使用spring mvc使用@RequestParam捕获一些参数?