leiningen - 如何添加依赖本地罐子? [英] leiningen - how to add dependencies for local jars?

查看:387
本文介绍了leiningen - 如何添加依赖本地罐子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用leiningen建立和发展我的Clojure项目。是否有修改project.clj告诉它从本地目录挑选一些罐子的方式?

I want to use leiningen to build and develop my clojure project. Is there a way to modify project.clj to tell it to pick some jars from local directories?

我无法上传到公开回购一些专有的罐子。

I have some proprietary jars that cannot be uploaded to public repos.

另外,可以leiningen用来维持Clojure的项目lib目录?如果一堆我的Clojure项目共享相同的罐子,我不想保持一个单独的副本为他们每个人。

Also, can leiningen be used to maintain a "lib" directory for clojure projects? If a bunch of my clojure projects share the same jars, I don't want to maintain a separate copy for each of them.

感谢

推荐答案

您可以把您的私人罐子在的lib / ,他们会在类路径上的目的的雷音斯旺克等等;这似乎打败使用依赖管理工具的地步,但如果你没有真正的希望的那些依赖关系管理,你可以把Leiningen作为开源依赖关系管理工具,也许要小心与雷音干净

You could put your private jars in lib/ and they'd be on the classpath for the purposes of lein swank and the like; this does seem to defeat the point of using a dependency management tool, though if you don't actually want those dependencies managed, you could treat Leiningen as an "open source dependencies management tool" and maybe be careful with lein clean.

随着形势变得更加复杂 - 有涉及,它们进化私人罐子更大数量,你需要采取一些版本的信息对他们的考虑 - 创建私有Maven的回购可能是更合适的亚瑟的想法

As the situation becomes more complex -- there's a larger number of private jars involved, they evolve and you need to take some versioning info on them into account -- Arthur's idea of creating a private Maven repo may be more appropriate.

(人力资源表示特定Leiningen部分的分界点以下......为继续在Clojure的土地总编译/依赖管理工具故事的信息,包括一些链接,我认为可以派上非常方便你的情况。)

此外,作为然而,对这个问题,其中为Clojure的,与Leiningen最好的构建工具,而在心灵占有率获得,也是在区域特点和波兰获得不断没有统一的协议 - 意思,特别是,它尚未完成。下面是从斯图尔特哈洛韦,务实书架的编程Clojure的的作者报价:我2C:Leiningen是重要的一步,但仍有很多工作要做。对于全发布和一个很有趣的讨论再度:构建工具和Clojure中的空间之类的,请参见 Leiningen, Clojure的和库:我缺少的是对谷歌的Clojure组线程?。许多与会者特别提到需要有没有包含在任何存储库本地依赖性,当地或其他地方,并阐明他们想出了这样的场景的解决方案。也许你可以看到,如果有什么事,在那里它现在就可以解决您的问题/解决可能会在将来,当功能集成熟?

Also, as of yet, there is no universal agreement on the question of which is the best build tool for Clojure, and Leiningen, while gaining in mindshare, is also constantly gaining in the areas features and polish -- meaning, in particular, that it's not yet complete. Here's a quote from Stuart Halloway, the author of Pragmatic Bookshelf's "Programming Clojure": "My 2c: Leiningen is an important step, but there is still plenty to do." For the full posting and a very interesting discussion re: build tools and the like in Clojure space, see the Leiningen, Clojure and libraries: what am I missing? thread on the Clojure Google group. Many participants specifically mention the need to have local dependencies not contained in any repositories, local or otherwise, and elaborate on the solutions they've come up with for such scenarios. Perhaps you could see if there's anything over there which can solve your problem now / might solve it in the future, when feature sets mature?

无论如何,这是可能的,Leiningen可能没有实际上有一个好故事还没有准备好对一些复杂的场景。如果你觉得这可能是你的情况也是如此(我的意思是,你认为私人回购主意),这里的一些链接Maven的基础,从上述线程采取替代方案:的通晓多种语言的Maven Clojure的,Maven的插件; 这个博客中的目标是成为人们试图使用Maven使用Clojure有用的。我记得,Meikel Brandmeyer(也所以在他的kotarak在线处理)使用摇篮(一个Groovy构建系统)用的插件,以适应Clojure的所谓Clojuresque;我从来没有尝试过自己,因为不知道关于Groovy的第一件事情,但他声称用它运行一个非常漂亮的建筑行为,我相信它有没有关系行家 - 这是在其本身有加对于我们中的一些。 : - )

Anyway, it is possible that Leiningen may not in fact have a good story ready yet for some complex scenarios. If you feel this may be true of your case (and I mean after you consider the private repo idea), here's some links to maven-based alternatives taken from the above mentioned thread: polyglot maven, clojure-maven-plugin; this blog posting aims to be useful to people trying to use maven with Clojure. As I recall, Meikel Brandmeyer (also on SO under his online handle of kotarak) uses Gradle (a Groovy build system) with a plugin to accomodate Clojure called Clojuresque; I never tried it myself, as don't know the first thing about Groovy, but he claims to run a very nice building act with it and I believe it's got nothing to do with maven -- something which is a plus in and of itself for some of us. :-)

这篇关于leiningen - 如何添加依赖本地罐子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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