[英]How to use leiningen to develop using local jars?
I realize that this question is pretty much the exact question found here . 我意识到这个问题几乎是这里发现的确切问题。 However, seeing as that question is 1.5 years old (or so), I would like to revisit it.
然而,看到这个问题是1.5岁(左右),我想重新审视它。 How does one add local dependencies using leiningen?
如何使用leiningen添加本地依赖项? Surely this capability must exist by now?
当然,这种能力必须存在吗?
创建一个私有Maven存储库 ,然后将以下内容添加到project.clj
:repositories {"local" ~(str (.toURI (java.io.File. "your_local_repository")))}
If the jars are based on your own projects, you can use lein install
to put them into your local .m2, or use the checkout-dependencies feature. 如果jar基于您自己的项目,您可以使用
lein install
将它们放入本地.m2,或使用checkout-dependencies功能。
You can also use the extra-classpaths feature, etc. 您还可以使用extra-classpaths功能等。
I found that the easiest (albeit somewhat hacky) solution is to do the following: 我发现最简单的(尽管有点hacky)解决方案是执行以下操作:
For an existing project that you're using as a dependency: 对于您用作依赖项的现有项目:
lein deps
lein deps
lein uberjar
in this dependency dir (where the relevant project.clj file lives) lein uberjar
中运行lein uberjar
(相关的project.clj文件所在的位置) For development of your own project: 为了开发自己的项目:
lein install
lein install
Again, this is a quick hack and perhaps not the way you'd go about doing serious local development, but I found it easy enough for what I wanted. 再一次,这是一个快速的黑客,也许不是你去做严肃的本地开发的方式,但我发现它很容易满足我想要的。 Check out
lein help tutorial
for much more info 查看
lein help tutorial
了解更多信息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.