Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse 使用maven时gpg没有默认密钥错误_Eclipse_Maven_Gnupg - Fatal编程技术网

Eclipse 使用maven时gpg没有默认密钥错误

Eclipse 使用maven时gpg没有默认密钥错误,eclipse,maven,gnupg,Eclipse,Maven,Gnupg,我正试图在中央存储库中发布我的maven项目,我需要对我的工件进行签名。我已经下载并安装了gpg,并创建了我的钥匙圈。在Eclipse中运行“maven clean deploy”时,出现以下错误: gpg: no default secret key: No secret key gpg: signing failed: No secret key 我在网上搜索过,不知道该怎么办。我的pom.xml文件中关于gpg的唯一参考是 <plugin> <g

我正试图在中央存储库中发布我的maven项目,我需要对我的工件进行签名。我已经下载并安装了gpg,并创建了我的钥匙圈。在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>   

org.apache.maven.plugins
maven gpg插件
1.5
符号伪影
验证
签名

谢谢

您无法对工件进行签名,因为您没有GPG密钥。解决办法是。

这个问题很久以前就被问到了,我记不清我到底做了什么来解决它。我确实记得我的
settings.xml
文件中有一个拼写错误。这是我在文件中更改的内容:

<profile>
  <id>sign</id>
  <activation>
      <activeByDefault>true</activeByDefault>
  </activation>
  <properties>
      <gpg.passphrase>password</gpg.passphrase>
  </properties> 
</profile>

签名
真的
密码

现在可以了。

我刚刚遇到了相同的错误消息。在我的例子中,它是由密钥过期引起的,如下命令所示:

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>
six-58:tmp hot$gpg——列出键
gpg:检查信任数据库
gpg:需要3个边际,1个完整,PGP信任模型
gpg:深度:0有效:1签名:0信任:0-,0q,0n,0m,0f,1u
/Users/hot/.gnupg/pubring.gpg
-----------------------------
2016年12月30日前发布的第2048R/236D3号公告[到期日期:2018年12月30日]
霍尔格瑟罗
请注意“[到期日期: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
six-58:tmp hot$gpg——编辑键236D3BEF
gpg(GnuPG)1.4.19;版权所有(C)2015免费软件基金会。
这是自由软件:您可以自由更改和重新发布它。
在法律允许的范围内,不存在任何担保。
密钥可用。
pub 2048R/236D3BEF创建日期:2016-12-30过期日期:2018-12-30用法:SC
信任:最终有效期:过期
sub 2048R/450709B5创建日期:2016-12-30到期日期:2018-12-30使用日期:E
[过期](1)。霍尔格·瑟罗
gpg>1
pub 2048R/236D3BEF创建日期:2016-12-30过期日期:2018-12-30用法:SC
信任:最终有效期:过期
sub 2048R/450709B5创建日期:2016-12-30到期日期:2018-12-30使用日期:E
[过期](1)*霍尔格·瑟罗
gpg>过期
更改主键的过期时间。
请指定密钥的有效期。
0=密钥未过期
=密钥在n天后过期
w=密钥在n周后过期
m=密钥在n个月后过期
y=密钥在n年后过期
密钥对有效吗?(0) 
密钥根本不会过期
这是正确的吗?(是/否)是
您需要密码短语来解锁的密钥
用户:“Holger Thurow”
2048位RSA密钥,ID 236D3BEF,创建于2016年12月30日
发布2048R/236D3BEF创建日期:2016-12-30到期日期:从不使用:SC
信任:最终有效性:最终有效性
sub 2048R/450709B5创建日期:2016-12-30到期日期:2018-12-30使用日期:E
[最终版本](1)*霍尔格·瑟罗
gpg>保存

请参阅详细描述的“处理过期密钥”。

但我确实创建了一个。它在我的.gnugp文件夹中。你找到了解决方案吗?我相信问题出在我的settings.xml文件上。我将检查我的另一台计算机,并让您知道更改的内容。我面临相同的问题,您是如何解决问题的?抱歉,耽搁了。这是很久以前的事了,我记不清我到底做了什么来修复它。我记得我的
设置文件中有一个拼写错误。请看下面我对我的文件的回答。