lein在mac上安装datomic peer library

sha*_*aft 8 clojure gnupg leiningen datomic

我无法让leiningen下载datomic-pro peer库.我有以下设置:

~/.lein/credentials.clj.gpg

{#"my\.datomic\.com" {:username "..."
                      :password "..."}}
Run Code Online (Sandbox Code Playgroud)

和项目

(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"]])
Run Code Online (Sandbox Code Playgroud)

我安装gpg via brew install 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.
Run Code Online (Sandbox Code Playgroud)

注意:我创建了一个pom.xml / settings.xml在主页上描述的,并立即工作maven.我也知道我可以直接安装对等库datomic/bin/maven-install,但我更喜欢普通leiningen安装.

ada*_*son 11

我也遇到了很多问题.根据您运行的操作系统,它会有所不同.对我有用的一件事是使用env vars而不是gpg路线.

将此添加到您的环境变量(.bashrc文件是unixy操作系统上最简单的)

export MY_DATOMIC_USERNAME="your@email.com"
export MY_DATOMIC_PASSWORD="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Run Code Online (Sandbox Code Playgroud)

重新加载bash并检查它们是否在那里:

$  echo $MY_DATOMIC_USERNAME
your@email.com
Run Code Online (Sandbox Code Playgroud)

然后将其添加到您的project.clj文件中:

:repositories [["my.datomic.com" {:url "https://my.datomic.com/repo"
                        :username [:env/my_datomic_username]
                        :password [:env/my_datomic_password]}]]
Run Code Online (Sandbox Code Playgroud)

当然,添加您想要的依赖项版本,例如:

[com.datomic/datomic-pro "0.9.4815.12"]
Run Code Online (Sandbox Code Playgroud)

之后lein deps你应该加载你需要的库.

希望这可以帮助.