我正在尝试使用 s3-wagon-private 插件。我有两个 lein 项目:
- X:我为进行一些数据处理而创建的库。有一些第三方依赖。
- Y:我为使用数据库而制作的库,具有 X 和一些第三方依赖项。
我的 ~/.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}]]}}
当我运行lein deploy private
时在项目 X 中,一切正常,并且已部署到 S3。
当我运行lein deploy private
时在项目 Y 中,它提示无法找到项目 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.
换句话说,它不会在我的私有(private) 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.
当我运行lein deps
时在项目 Y 中,它不给出任何错误:
(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}]]
看来 Project Y 没有从我的 ~/.lein/profiles.clj 文件中获取 :repositories。但 Project X 似乎很好地接受了它。
最佳答案
问题在于 :repositories
是在用户 ~/.lein/profiles.clj
文件中指定的。莱宁根doesn't really like this 。我怀疑这里存在一个潜在的错误,可能是在 Lein 插件和依赖解析系统之间的交互中。因为通常不建议将 :repositories
放入您的用户个人资料中,人们以前可能没有遇到过这种情况。
我认为最好的解决方案可能是将 :repositories
添加到每个文件中,尽管这可能很烦人。
关于clojure - (leiningen, s3-wagon-private) 如何在私有(private) S3 存储库中搜索依赖项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36812269/