(leiningen, s3-wagon-private) 如何在私有 S3 存储库中搜索依赖项?

(leiningen, s3-wagon-private) How to search for dependencies in private S3 repo?

我正在尝试使用 s3-wagon-private 插件。我有两个 lein 项目:

我的 ~/.lein/profiles.clj 文件中有以下内容:

{:repl {:dependencies [[org.clojure/tools.nrepl "0.2.12"]]}
 :user {:plugins [[cider/cider-nrepl "0.10.0"]
              [s3-wagon-private "1.2.0"]]
 :signing {:gpg-key "0xabcdef12"}
 :repositories [["private" {:url "s3p://acme/releases/"
                            :username :env
                            :passphrase :env}]]}}

当我在项目 X 中 运行 lein deploy private 时,一切正常,它被部署到 S3。

当我在项目Y运行lein deploy private时,提示找不到项目X

Could not find artifact X:X:jar:0.7.0 in central (https://repo1.maven.org/maven2/)
Could not find artifact X:X:jar:0.7.0 in clojars (https://clojars.org/repo/)
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.

换句话说,它不是在我的私有 S3 存储库中寻找项目 X。我该如何解决这个问题?


更新:2016-04-25

丹尼尔康普顿在评论中问道:

What happens when you run lein deps in project Y? From your error message, it looks like the repository "private" isn't present in project Y.

当我在项目 Y 中 运行 lein deps 时,它确实 NOT 给出任何错误:

(py3)aj-laptop:red aj$ lein deps
(:repositories detected in user-level profiles! [:user] 
See https://github.com/technomancy/leiningen/wiki/Repeatability)

所以我将以下内容添加到项目 Y 中的 project.clj。这使得 lein deploy private 按预期工作:

:repositories [["private" {:url "s3p://acme/releases/"
                           :username :env
                           :passphrase :env}]]

看来项目 Y 没有从我的 ~/.lein/profiles.clj 文件中获取 :repositories。但是 Project X 似乎很好地接受了它。

问题是在用户 ~/.lein/profiles.clj 文件中指定了 :repositories。莱宁根 doesn't really like this。我怀疑这里有一个潜在的错误,可能是在 Lein 插件和依赖解析系统之间的交互中。因为通常不建议将 :repositories 放入您的用户个人资料中,因此人们可能以前没有 运行。

我认为最好的解决方案可能是将 :repositories 添加到每个文件,尽管这可能很烦人。