gpg没有使用maven的默认密钥错误 [英] gpg no default secret key error using maven
问题描述
我正在中央存储库中发布我的maven项目,我需要签署我的文物。我已经下载并安装了gpg并创建了我的密钥环。当我在Eclipse中运行maven clean deploy时,我收到以下错误:
I am trying to publish my maven project in the Central Repository and I need to sign my artifacts. I have downloaded and installed gpg and created my keyring. When I run a "maven clean deploy" in Eclipse, I get the following error:
gpg: no default secret key: No secret key
gpg: signing failed: No secret key
我已经在线搜索,不知道该怎么办。在我的pom.xml文件中,关于gpg的唯一参考是
I have searched online and I am not sure what to do. The only reference about gpg in my pom.xml file is
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
谢谢!
推荐答案
这个问题很久以前被问到,我不记得我做了什么来修复它。我记得我的 settings.xml
文件中有拼写错误。这是我在我的文件中更改的:
This questions was asked a long time ago and I cannot remember exactly what I did to fix it. I do remember I had a spelling mistake in my settings.xml
file. This is what I changed in my file:
<profile>
<id>sign</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.passphrase>password</gpg.passphrase>
</properties>
</profile>
现在可以使用。
这篇关于gpg没有使用maven的默认密钥错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!