在 clojure 资源路径中包含许多 jar

Include many jars in clojure resource-paths

直到现在我在 lib/ 文件夹下添加了一些 jar,然后我在 project.clj 内的 "resources-path" 字段中写了 "lib/a.jar"。现在我想添加 20 个罐子。是否有更好和更短的方式来声明这些 jar,而不是一个接一个地显式定义每个 jar?

在 Leiningen 项目中,处理 dependencies is to add them to your :dependencies vector in project.clj. For instance, if your only dependencies are GAX-Java 和 Clojure 本身的标准方法,您的依赖向量将如下所示:

:dependencies [[org.clojure/clojure "1.8.0"]
               [com.google.api/gax "0.0.13"]]

默认情况下,Leiningen 将在 Maven Central and Clojars repositories, so in this case, it will find this artifact for Clojure and this artifact 中查找 GAX-Java.

的依赖项

如果您需要一个在不同存储库中可用但在 Central 或 Clojars 中不可用的库,您可以按照说明添加该存储库 in the Leiningen tutorial

最后,如果您需要的库在任何 Maven 存储库中找不到,您可以手动下载JAR 并将其放在[=13] 中的目录中=],但通常不推荐这样做,只能作为最后的手段使用。