[英]When a 3rd party Java library is supplied as a collection of individual jars, what is the best way to integrate it in a Maven project?
One of the 3rd party libraries used in my company is supplied to us as a zip file with tens of jars in it. 我公司使用的第三方库之一作为zip文件提供给我们,其中包含数十个罐子。 The library releases a new version every two weeks, so I am looking for a solution that does not require a lot of manual effort each time a new release is out.
该库每两周发布一个新版本,因此我正在寻找一种解决方案,每次新版本发布时都不需要大量的手动工作。 I have recently started using Maven for dependency management and I have found it very difficult to deal with this particular 3rd party library.
我最近开始使用Maven进行依赖管理,我发现很难处理这个特定的第三方库。 Should I...
我是不是该...
add each individual jar to a company-internal repository (eg with Nexus) and then declare each one of them as a dependency to any new projects using this library? 将每个jar添加到公司内部存储库(例如使用Nexus),然后将每个jar声明为使用此库的任何新项目的依赖项? This is a laborious process and I can't imagine doing this for every new release.
这是一个费力的过程,我无法想象每个新版本都会这样做。
create a jar of jars to add to our repository? 创建一罐罐子添加到我们的存储库? If so, how do I create it?
如果是这样,我该如何创建它? The Maven shade plugin would require that I mavenise the library first, right?
Maven的阴影插件需要我首先对图书馆进行mavenise,对吧?
any better suggestions? 更好的建议?
Your first option is the best practice. 您的第一个选择是最佳做法。 I'm not sure why it should be laborious.
我不确定为什么它应该是费力的。
Should be all of 5 minutes to add a new release to your build pipeline. 应该在5分钟内将新版本添加到构建管道中。
Alternative: convince the third-party to setup a maven repository for their customers to use! 替代方案:说服第三方为其客户设置maven存储库!
Its possible, but complicated (but only a 1 time effort) and probably a misuse of what maven's meant for: 它可能,但很复杂(但只有一次努力),可能是滥用maven的意思:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.