简体   繁体   English

使用Leiningen与本地M2存储库

[英]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 我想将一个本地jar编译到我的clojure项目中,我可以使用以下内容轻松完成

https://gist.github.com/stuartsierra/3062743 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. 但我有一个持续集成和构建服务器(jenkins),它在〜/ .m2中查找。 How can I get leiningen to look in .m2??? 我怎样才能让莱宁根看到.m2 ???

Based on the documentation , it looks like the key you're after is :local-repo in project.clj . 根据文档 ,看起来你所关注的关键是:local-repo project.clj :local-repo 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 . 由于您希望在不同的服务器上拥有不同的本地存储库位置,因此我将其置于配置文件中 ,而不是直接在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: 可能最好的方法是在想要更改本地存储库位置的任何一台机器上的~/.lein/profiles.clj创建一个:user配置文件:

{:user {:local-repo "repo"}}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM