将第3方jar部署到clojars? [英] Deploy 3rd-party jar to clojars?

查看:88
本文介绍了将第3方jar部署到clojars?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Clojure项目中使用了第三方开源Java库.它在Maven Central或Clojars中不可用.我可以创建一个pom文件并弄清楚如何在Maven Central中安装它,但是-我很懒,我习惯了Clojure工具(如Leiningen)的更多便利!有没有将第三方jar部署到Clojars的便捷方法?无需先构建它.它已经被建造了. (Java库使用tryed和true-make.)

I'm using a 3rd-party open source Java library with my Clojure project. It's not available in Maven Central or at Clojars. I can create a pom file and figure out how to install it a Maven Central, but--I am lazy and I am used to the increased convenience of Clojure tools such as Leiningen! Is there a convenient way to deploy the 3rd party jar to Clojars? There's no need to build it first; it's already been built. (The Java library uses the tried and true--make.)

如果我必须放弃自己的懒惰,我会,但是如果没有,为什么要打扰? (从另一方面来说,我可能已经花了更多的时间来尝试这一点,阅读莱宁根的文档和博客文章,并在此处提出这个问题,比我坐下来制作一个pom文件所花的时间要多得多,等等,到目前为止,我一直找不到答案.懒惰很耗时!)

If I must give up my laziness, I will, but if not, why bother? (On the other hand, I've already probably spent more time trying this and that, reading Leiningen documentation and blog posts, and asking this question here, than I would have spent if I'd just sat down and made a pom file, etc. I've been unable to find an answer, so far. Laziness is time-consuming!)

推荐答案

您有一些选择.

首先,我不会在公共场所安装您不拥有版权的罐子.

First, I wouldn't install a jar for which you don't own the copyright in a public place.

通过Maven/Leiningen访问任意jar的最简单方法是将jar安装到本地存储库中.例如,如果希望您的依赖项看起来像[com.example.foo/bar "1.0.0"],则可以使用mvn命令安装它.

The easiest way to have access to an arbitrary jar via Maven/Leiningen would be to "install" the jar int your local repository. For example, if want your dependency to look like[com.example.foo/bar "1.0.0"], you would install it with the mvn command.

mvn -Dfile=your.jar \
    -DgroupId=com.example.foo \
    -DartifactId=bar \
    -Dversion=1.0.0 \
    -Dpackaging=jar \
    -DgeneratePom=true

这使依赖项仅对您可用.如果您在团队中,则可以要求每个人都运行此命令.但是,如果您不介意花一点钱,则可以使用 s3-wagon-private .

This makes the dependency available only to you. If you're on a team, you could require each person to run this command. However, if you don't mind spending a little money, you could host your own repository on S3 using s3-wagon-private.

还有诸如 Archiva

There's also repository managers like Archiva, Artifactory, and NEXUS.

这篇关于将第3方jar部署到clojars?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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