1

我有一个名为Parallel的 Clojure 项目,这取决于另一个名为Messaging的 Clojure 项目,我使用lein jar命令生成了messing-0.1.0-SNAPSHOT.jar文件,然后我按照页面https://github.com/kumarshantanu上的说明进行操作/lein-localrepo尝试将本地 jar 依赖项添加到并行项目。
首先,我在Parallel项目的根目录下创建了一个名为lib的目录。然后,我使用命令将消息传递库安装到本地存储库lib。第三,我在Parallel的project.clj文件中添加了依赖lein localrepo coords messaging-0.1.0-SNAPSHOT.jar | xargs lein localrepo install -r lib项目如下:

(defproject parallel "0.1.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [...]
                 [messaging "0.1.0-SNAPSHOT"]]
  :plugins [[lein-localrepo "0.5.2"]]
  :repositories {"local" ~(str (.toURI (java.io.File. "lib")))})

但是,最后,当我运行时lein deps,出现以下错误:

Retrieving messaging/messaging/0.1.0-SNAPSHOT/messaging-0.1.0-SNAPSHOT.pom from local
Could not transfer artifact messaging:messaging:pom:0.1.0-SNAPSHOT from/to local (file:/home/mixi/Workspace/Projects/clojure/parallel/lib/): no supported algorithms found
This could be due to a typo in :dependencies or network issues.

我不知道为什么。我已经对此问题进行了一些研究,例如将本地 jars 与 Leiningen 一起使用以及如何为 Leiningen 配置专有依赖项?,但我仍然找不到出路。

那么正确的方法是什么?

4

2 回答 2

2

添加groupIdmessaging项目,运行lein install,修改dependencies。不需要:repositories,从 ~/.m2 存储库获取文件。

于 2013-08-27T05:02:09.643 回答
0

当您在其中提及时:repositoriesproject.clj它表示从中下载工件的 URL。要指定本地存储库,请使用:local-repo. 请参阅此处:https ://github.com/technomancy/leiningen/blob/master/sample.project.clj并搜索:local-repo.

于 2013-11-13T03:56:34.947 回答