Gradle uploadArchives任务无法读取密钥 [英] Gradle uploadArchives task unable to read secret key

查看:754
本文介绍了Gradle uploadArchives任务无法读取密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了gradle项目,并且一切正常,但是当我尝试上传到Maven存储库时,出现以下Gradle错误:

I have created a gradle project and everything builds fine, but when I try to upload to my Maven repository, I get the following Gradle error:

FAILURE: Build failed with an exception.

* What went wrong:
Could not evaluate onlyIf predicate for task ':library:signArchives'.
> Unable to read secret key from file: C:\Users\ideal\pubring.gpg (it may not be a PGP secret key ring)

我按照Sonatype上的 生成密钥,然后将其从生成的位置复制到上面列出的位置。我还向MIT密钥库发布了公共密钥。我的用户目录中的 gradle.properties 文件包含与钥匙串相关的以下条目:

I followed the instructions at Sonatype to generate the key, then copied it from its generated location to the location listed above. I have also published the public key to MITs key repository. The gradle.properties file in my user directory contains the following entries related to the keychain:

signing.keyId=MY_KEY_ID
signing.password=MY_KEY_PASSWORD
signing.secretKeyRingFile=C:\\Users\\ideal\\pubring.gpg

这是在Windows平台上。我尝试搜索错误消息,但唯一出现的是相关插件的源文件。

This is on a Windows platform. I have tried searching for the error message but the only thing which comes up is the source files for the related plugins.

推荐答案

问题是您正在使用公用密钥,请切换到通常名为 secring.gpg的秘密密钥。
因此,在您的情况下,应将其放置在

The problem is that you are using the public key, switch to the secret key, normally named "secring.gpg". So in your case it should placed in


C:\Users\ideal\secring.gpg

C:\Users\ideal\secring.gpg

这篇关于Gradle uploadArchives任务无法读取密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆