clojure – ‘lein deploy clojars’不要求密码短语

我想使用Leiningen部署Clojure库.我做了以下事情:

>安装了gpg
>创建了一个gpg密钥对
>将我的Clojars凭证加密成〜/ .lein / credentials.clj.gpg
>安装了gpg-agent
>安装Keychain

当我调用’lein deploy clojars’时,我得到以下输出:

WARNING: please set :license in project.clj.
Could not decrypt credentials from ~/.lein/credentials.clj.gpg
gpg: can't query passphrase in batch mode
gpg: decryption failed: secret key not available

See `lein help gpg` for how to install gpg.
No credentials found for clojars
See `lein help deploy` for how to configure credentials.
Username:

然后我卸载了gpg,安装了gpg2并制作了一个从gpg到gpg2的符号链接.当我现在称’lein deploy clojars’时,我得到:

WARNING: please set :license in project.clj.
^CCould not decrypt credentials from ~/.lein/credentials.clj.gpg
pinentry-curses: no LC_CTYPE known - assuming UTF-8
pinentry-curses: no LC_CTYPE known - assuming UTF-8
pinentry-curses: no LC_CTYPE known - assuming UTF-8
pinentry-curses: no LC_CTYPE known - assuming UTF-8

gpg: signal Interrupt caught ... exiting

See `lein help gpg` for how to install gpg.
No credentials found for clojars
See `lein help deploy` for how to configure credentials.
Username: 

在警告之后,命令等待输入,我只能通过按ctrl-c退出.

任何人都可以告诉我,为了部署库我需要做什么?

最佳答案 lein使用
lein-clojar plugin尽可能简单地部署到clojars.

首先,使用以下内容创建〜/ .lein / profiles.clj文件:

{:user {:plugins [[lein-clojars "0.9.1"]]}}

不幸的是,你不能使用带有lein-clojar插件的密码密钥,但你可以使用lein keygen命令生成新的ssh密钥.它会将新的ssh密钥放入〜/ .leiningen /,因此它只能由lein使用.

生成密钥后,lein会将其公共部分打印到控制台.您应该将其复制到您的clojars帐户.

最后,您可以使用lein push部署项目.

当然,您可以使用lein deploy clojars和任何ssh或pgp密钥在没有此插件的情况下部署项目.也许,使用带有lein deploy clojars的路径密钥是可能的,但我不确定.

点赞