3 ms·
I am still pretty new to clojure, but I really wish adding jars that are not located in clojars or maven was a little easier (and more straightforward). Yes, I
by notdarkyet 14y ago
I am still pretty new to clojure, but I really wish adding jars that are not located in clojars or maven was a little easier (and more straightforward).
Yes, I could always take the Java project, rebuild and upload it myself. It would be nice to just drop the jar in the libs dir and go from there.
Maybe this is already possible (but undocumented), but with all questions out there from a simple search there is no clear way to do this that is not some sort of a hack.
- vemv 14y agoHere you go: http://blog.markwatson.com/2012/07/my-simple-hack-for-using-local-jar.html http://blog.markwatson.com/2012/07/my-simple-hack-for-using-... From what I know, lein's policy is to make adding .jars as hard as possible. Update: just found this other method http://www.pgrs.net/2011/10/30/using-local-jars-with-leiningen/ http://www.pgrs.net/2011/10/30/using-local-jars-with-leining... which looks cleaner - just a bit harder (see the last comment).
- deleted 14y ago[deleted]
- jballanc 14y agoLeiningen's package management is built upon Maven's package management. This means that you can add artifacts directly to your local maven repo (typically located at ~/.m2) to have them used instead. I do this frequently by checking out a project and running `mvn install` or (if it's already a Leiningen-based project) `lein install`.
- xeqi 14y agoFinding information on lein2 vs lein1 is a bit difficult. For example, one of the sibling comments points to a way to add them that worked in lein1 but not lein2. Too bad there is not a way to tell google some pages are outdated. There is a general policy of trying to encourage repeatability with lein. Use of non-mavenized jars makes it much harder to have repeatability. I'd have to go track down the jar by hand to fork, or possibly even use the project. However, for lein2 you can add the jar to your ```:resource-paths```. This will abuse the way resources are added to the classpath and also include the extra jar. Good for exploring, but try not to publish any projects with that.
- kumarshantanu 14y agoThis page discusses the issue in question: http://j.mp/repeatability http://j.mp/repeatability Jump to section 'Free-Floating Jars' if you're feeling impatient. :)
- moomin 14y agoMore features than you could possibly want: https://github.com/technomancy/leiningen/blob/master/sample.project.clj https://github.com/technomancy/leiningen/blob/master/sample.... But you'd be better off creating your own private repository than messing with free-floating jars.
- HillOBeans 14y agoThis is a problem I have wrestled with on several occasions and the solution I choose is the lein-localrepo plugin.