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

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

问题描述

我想将本地 jar 编译到我的 clojure 项目中,我可以使用以下内容轻松完成

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

但我有一个持续集成和构建服务器 (jenkins),它在 ~/.m2 中查找.我怎样才能让 leiningen 在 .m2 中查看???

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

推荐答案

基于 文档,看起来您要查找的密钥是 project.clj 中的 :local-repo.由于您希望在不同的服务器上拥有不同的本地存储库位置,我会将其放在 配置文件中 而不是直接在 project.clj 中.

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.

可能最好的方法是在您想要更改本地位置的任何机器上的 ~/.lein/profiles.clj 中创建一个 :user 配置文件存储库:

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天全站免登陆