Maven:是否可以将一组 3rd 方 jar 上传到存储库,然后可以将其作为单个依赖项引用? [英] Maven: Is it possible to upload a set of 3rd party jars to repository, which can then be referenced as a single dependency?

查看:15
本文介绍了Maven:是否可以将一组 3rd 方 jar 上传到存储库,然后可以将其作为单个依赖项引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在为第三方 jar 使用内部 Nexus 存储库,这些 jar 是我们应用程序中的依赖项.

We are using an internal Nexus Repository for third party jars which are dependencies in our applications.

我正在开始一个新项目,并且有一组 4 个第三方 jar 文件,我想将它们上传到 Nexus,然后在理想情况下作为我的项目 pom.xml 中的单个依赖项(即 artifactId/version)引用.

I am starting a new project, and have a set of 4 third party jar files which I want to upload to Nexus, and then reference, ideally, as a single dependency (i.e. artifactId/version) from my project pom.xml.

这些 jar 总是一起提供,从不单独进行版本控制,因此为每个 jar 设置单独的 artifactId/version 组合是没有用的.是否可以将所有 jar 文件上传到 Nexus 中的单个工件/版本文件夹中,然后在我的 Maven 项目中将它们作为单个依赖项引用?

These jars are always given together, never versioned separately, so having a separate artifactId/version combination for each jar is not useful. Is it possible to upload all the jars into a single artifact/version folder in Nexus, and then to reference them as a single dependency in my Maven project?

推荐答案

正如您在评论中提到的,您可以创建自己的 pom 文件,该文件取决于您谈论的四个 jar.然后,将其发布到您的本地关系网.完成后,您可以将其作为 pom 依赖项进行依赖,它将引入您想要的四个库.

As you refer to in your comment, you can create a pom file of your own that depends on the four jars you talk about. Then, release this to your local nexus. Once this is done, you can depend on it as a pom dependency, which will bring in the four libraries you want.

这篇关于Maven:是否可以将一组 3rd 方 jar 上传到存储库,然后可以将其作为单个依赖项引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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