gpt4 book ai didi

eclipse - gpg没有使用maven的默认 key 错误

转载 作者:行者123 更新时间:2023-12-03 22:34:32 25 4
gpt4 key购买 nike

我正在尝试在中央存储库中发布我的 maven 项目,我需要签署我的 Artifact 。我已经下载并安装了 gpg 并创建了我的 key 环。当我在 Eclipse 中运行“maven clean deploy”时,出现以下错误:

gpg: no default secret key: No secret key
gpg: signing failed: No secret key

我在网上搜索过,我不知道该怎么办。我的 pom.xml 文件中关于 gpg 的唯一引用是
    <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>

谢谢!

最佳答案

我刚刚遇到了同样的错误信息。在我的情况下,它是由 key 过期引起的,如下命令所示:

six-58:tmp hot$ gpg --list-keys
gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u
/Users/hot/.gnupg/pubring.gpg
-----------------------------
pub 2048R/236D3BEF 2016-12-30 [expired: 2018-12-30]
uid Holger Thurow <...@gmail.com>

请注意“[过期:2018-12-30]”。

这是我为解决问题所做的:
six-58:tmp hot$ gpg --edit-key 236D3BEF
gpg (GnuPG) 1.4.19; Copyright (C) 2015 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Secret key is available.

pub 2048R/236D3BEF created: 2016-12-30 expired: 2018-12-30 usage: SC
trust: ultimate validity: expired
sub 2048R/450709B5 created: 2016-12-30 expired: 2018-12-30 usage: E
[ expired] (1). Holger Thurow <...@gmail.com>

gpg> 1

pub 2048R/236D3BEF created: 2016-12-30 expired: 2018-12-30 usage: SC
trust: ultimate validity: expired
sub 2048R/450709B5 created: 2016-12-30 expired: 2018-12-30 usage: E
[ expired] (1)* Holger Thurow <...@gmail.com>

gpg> expire
Changing expiration time for the primary key.
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0)
Key does not expire at all
Is this correct? (y/N) y

You need a passphrase to unlock the secret key for
user: "Holger Thurow <...@gmail.com>"
2048-bit RSA key, ID 236D3BEF, created 2016-12-30


pub 2048R/236D3BEF created: 2016-12-30 expires: never usage: SC
trust: ultimate validity: ultimate
sub 2048R/450709B5 created: 2016-12-30 expired: 2018-12-30 usage: E
[ultimate] (1)* Holger Thurow <...@gmail.com>

gpg> save

详见“处理过期 key ” here .

关于eclipse - gpg没有使用maven的默认 key 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29885887/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com