Thursday, September 6, 2012

[Clojure] how to setup local git repo as dependency in lein?

<gerry`> how to setup local git repo as dependency in lein?

<gerry`> or local clojure***.jar as dependency?

<xeqi> gerry`: are you building clojure from source and want to use it as a dependency in lein?

<gerry`> xeqi: right.

<xeqi> run `mvn install` in your local clojure checkout.  That will put [org.clojure/clojure "1.5.0-master-SNAPSHOT"] into your local ~/.m2 cache which lein can then use

<xeqi> assuming your on a recent clone

<xeqi> and didn't change the groupId, artifactId, or version in clojure's pom.xml

<gerry`> and use [org.clojure/clojure "1.5.0-master-SNAPSHOT"] as dependency in my project.clj file?

<xeqi> yes

<gerry`> ok,thx

<firesofmay> xeqi, will this work for other libraries as well (written in clojure)? or is this only for building clojure language itself?

<firesofmay> xeqi, and won't this conflict if I want to use the original library as well?

<xeqi> firesofmay: if the dependency is a maven or lein project `mvn install` or `lein install` will work.  otherwise if you just have a free floating jar something like lein-localrepo will be needed

<xeqi> trying to use 2 vesions of the same library in the same project would conflict anyways

<xeqi> ~repeatability

<clojurebot> repeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability

<firesofmay> xeqi, i mean in different projects. if i want to test my new version in  a new project and still use old version in other project i.e.

<xeqi> firesofmay: that works fine.  The jars end up in ~/.m2 under a groupid/artifactid/version scheme

<firesofmay> xeqi, okay thanks for answering.

<xeqi> so as long as you don't use install a jar with the same version as an already installed jar, the ~/m2 cache has both

<firesofmay> xeqi, okay.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.