Local dependencies in Leiningen without creating a Maven repo?

时光毁灭记忆、已成空白 提交于 2020-01-22 19:28:12

问题


I'm building a Compojure web application, and I'd like it to use functions from another Clojure project I wrote. I'm not at all familiar with Maven, and from what I've heard, it has a very steep learning curve. Unfortunately, everything I've seen suggests using a private Maven repo as a dependency and doesn't suggest an alternative. I'd really like to avoid struggling with Maven if possible. Does anyone know of an alternative? I'm currently using the latest version of Leiningen.


回答1:


If the other project is also a lein project, you just need to do a "lein install" and that will take care of creating all the local maven repo stuff. Then you can just depend on that project as you would do with any other lib. For example:

 (defproject mylib "1.0"
      ....)

  lein install

  (defproject myotherproject "a.b.c"
     :dependencies [[mylib "1.0"]]
     .....)

If you are sharing "myotherproject" with other people and you want to remove some of the inconvenience of doing a "lein install" every time you change the mylib project, have a look at the lein checkouts feature and then use the equivalent of svn externals of your VCS of choice.



来源:https://stackoverflow.com/questions/25145487/local-dependencies-in-leiningen-without-creating-a-maven-repo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!