Clojure lein在mac上安装datomic对等库
我无法让leiningen下载datomic pro对等库。我有以下设置:Clojure lein在mac上安装datomic对等库,clojure,leiningen,gnupg,datomic,Clojure,Leiningen,Gnupg,Datomic,我无法让leiningen下载datomic pro对等库。我有以下设置: ~/.lein/credentials.clj.gpg {#"my\.datomic\.com" {:username "..." :password "..."}} 项目呢 (defproject datomic-example "0.1.0-SNAPSHOT" :repositories {"my.datomic.com" {:url "https://my.da
~/.lein/credentials.clj.gpg
{#"my\.datomic\.com" {:username "..."
:password "..."}}
项目呢
(defproject datomic-example "0.1.0-SNAPSHOT"
:repositories {"my.datomic.com" {:url "https://my.datomic.com/repo"
:creds :gpg}}
:dependencies [[org.clojure/clojure "1.6.0"]
[com.datomic/datomic-pro "0.9.4956"]])
我通过brew install gpg
安装gpg,然后运行lein deps
会出现以下错误:
Could not decrypt credentials from /Users/.../.lein/credentials.clj.gpg
gpg: no valid OpenPGP data found.
gpg: decrypt_message failed: eof
See `lein help gpg` for how to install gpg.
(Could not transfer artifact com.datomic:datomic-pro:pom:0.9.4956 from/to my.datomic.com (https://my.datomic.com/repo): Not authorized , ReasonPhrase:Unauthorized.)
This could be due to a typo in :dependencies or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
注意:我按照主页上的描述创建了一个
pom.xml/settings.xml
,它可以立即与maven
一起工作。我也知道我可以直接从datomic/bin/maven install
安装对等库,但我更喜欢普通的leiningen
安装。根据您运行的操作系统的不同,它会有所不同。一件对我有效的事情是使用env vars而不是gpg路由
将其添加到环境变量(.bashrc文件是unixy OSs上最简单的文件)
重新加载bash并检查它们是否存在:
$ echo $MY_DATOMIC_USERNAME
your@email.com
然后将其添加到project.clj
文件中:
:repositories [["my.datomic.com" {:url "https://my.datomic.com/repo"
:username [:env/my_datomic_username]
:password [:env/my_datomic_password]}]]
当然,也可以在依赖项中添加您想要的版本,例如:
[com.datomic/datomic-pro "0.9.4815.12"]
在lein deps
之后,您应该已经加载了所需的libs
希望这有帮助。我发现:
在这里,您可以使用凭据创建~/.lein/credentials.clj
文件:
{#"my\.datomic\.com" {:username "USERNAME"
:password "PASSWORD"}}
然后使用gpg对其进行加密:
$ gpg --default-recipient-self -e ~/.lein/credentials.clj > ~/.lein/credentials.clj.gpg
对我来说很有用,我希望它对我有帮助我必须先运行
gpg--gen key
,然后才能运行(在brew安装gpg
之后)尝试了这个,但我仍然得到了这个结果:“无法将工件com.datomic:datomic pro:pom:0.9.5206从/传输到my.datomic.com():未授权,原因短语:未授权。这可能是因为键入了:依赖项或网络问题。如果您在代理之后,请尝试设置“http_proxy”环境变量。“@letronje您找到了吗?我在流浪汉身上也有同样的经历
$ gpg --default-recipient-self -e ~/.lein/credentials.clj > ~/.lein/credentials.clj.gpg