项目级自我放置罐的Maven依赖 [英] Maven dependency for self placed jars in project level

查看:140
本文介绍了项目级自我放置罐的Maven依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了java类并转换为jar文件。所以,我想使用那些我在项目级别放置的jar文件,例如External Jar。
所以我需要在maven中编写一个依赖项,当有人导入我的项目时,他们应该可以运行该程序。

I created the java class and converted into jar files. So, I want to use those jar files which I have placed in project level in some folder like "External Jar". So I need to write a dependency in maven that when someone imports my project they should be able to run the program.

推荐答案

基本上你创建了自己的jar并且想要发布这个jar,所以当别人克隆/使用你的项目时,这个jar会附带(假设你有一个maven项目,你的jar的依赖项包含在pom中。 xml)。

Basically you created your own jar and you want to publish this jar, so that when somebody else clone/use your project, this jar comes with (assuming that you have a maven project and dependency of your jar is included in pom.xml).

要实现这一点,您需要将jar发布到maven,您可以关注许多在线文档,例如 http://kirang89.github.io/blog/2013/01/20/关于如何将jar发布到maven central的上传你的jar-to-maven-central /

To achieve this, you need to publish your jar to maven , you can follow many of the online docs like http://kirang89.github.io/blog/2013/01/20/uploading-your-jar-to-maven-central/ on how to publish jar to maven central.

修改: - 如由khmarbaise建议,请使用官方参考 http://central.sonatype.org/ 中央存储库。

- As suggested by khmarbaise, please use official reference http://central.sonatype.org/ for central repository.

这篇关于项目级自我放置罐的Maven依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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