How to solve "No credentials found for releases (did you mean `lein deploy clojars`?)"?

时间:2016-09-01 06:30:40

标签: clojure release leiningen

I'm trying to deploy a (non-snapshot) library to Clojars using Leiningen. I've actually been able to deploy this library before but it was a while ago and now I've made some fixes that I want to release. I even have a small bash script that used to handle the release and deploy process that essentially just do:

RELEASE_VERSION=${releaseVersion} lein release

Where releaseVersion is supplied as a parameter to the script. I'm using the lein-release plugin and I've specified:

:lein-release {:deploy-via :clojars}

in my project.clj. I also have working (or at least they used to work) GPG credentials in /Users/johan/.lein/credentials.clj.gpg.

When running lein release I'm prompted for my GPG password but after a couple of seconds I run into this:

$ RELEASE_VERSION=0.2.1 lein release
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
[master cf4e5d1] Version 0.2.1
 1 file changed, 1 insertion(+), 1 deletion(-)

You need a passphrase to unlock the secret key for
user: "Johan <email>"
2048-bit RSA key, ID ABC123431, created 2015-11-12

No credentials found for releases (did you mean `lein deploy clojars`?)
Password prompts are not supported when ran after other (potentially)
interactive tasks.
See `lein help deploy` for an explanation of how to specify credentials.

I've also tried setting repositories in my project.clj:

:repositories [["releases" {:url "http://clojars.org/repo" :creds :gpg}]]

But it doesn't make any difference. Does anyone know how to solve this?

1 个答案:

答案 0 :(得分:2)

问题是我在[lein-release "1.0.9"]文件中意外删除了{:user {:plugins .. }}中的~/.lein/profiles.clj。当我再次添加它时,一切都按预期工作。