使用Leiningen与本地M2存储库 [英] Use Leiningen With Local M2 Repository

查看:219
本文介绍了使用Leiningen与本地M2存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编译一个本地jar到我的clojure项目,我可以很容易与以下

这样做

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 =但我有一个持续集成和构建服务器(jenkins),在〜/ .m2中查找。我怎么能leiningen看看.m2 ???

解决方案

基于文档,看起来你在项目中的:local-repo clj 。由于您希望在不同的服务器上具有不同的本地存储库位置,因此我会将其放在个人资料< a>,而不是直接在 project.clj 中。



可能最好的办法是创建一个<在您要更改本地存储库位置的任何计算机上的〜/ .lein / profiles.clj 中的code>:user

  {:user {:local-reporepo}} 


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???

解决方案

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"}}

这篇关于使用Leiningen与本地M2存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆