Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Leiningen With Local M2 Repository

I want to compile a local jar into my clojure project, I can do this easily with the following

https://gist.github.com/stuartsierra/3062743

mkdir repo
mvn install:install-file -DgroupId=local -DartifactId=bar \
    -Dversion=1.0.0 -Dpackaging=jar -Dfile=bar.jar \
    -DlocalRepositoryPath=repo

But I have a continuous integration and build server (jenkins) that looks in ~/.m2. How can I get leiningen to look in .m2???

like image 913
David Williams Avatar asked Jun 11 '13 02:06

David Williams


1 Answers

Based on the documentation, it looks like the key you're after is :local-repo in project.clj. Since you want to have different local repository locations on different servers, I would put this in a profile as opposed to directly in the project.clj.

Probably the best approach would be to create a :user profile in ~/.lein/profiles.clj on whichever machine you want to change the location of the local repository:

{:user {:local-repo "repo"}}
like image 166
Alex Avatar answered Oct 18 '22 03:10

Alex