Maven: Is it possible to upload a set of 3rd party jars to repository, which can then be referenced as a single dependency?(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 上传到存储库,然后可以将其作为单个依赖项引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Maven:是否可以将一组 3rd 方 jar 上传到存储库,然后可以将其作为单个依赖项引用?
基础教程推荐
- 如何在相机中应用自定义滤镜 [Surfaceview 预览]. 2022-01-01
- 在java中使用xpath和selenium解析HTML表格数据 2022-01-01
- 控制台应用程序中的 Java 键盘输入解析 2022-01-01
- JPA惰性列表上的流 2022-01-01
- Java ECDSAwithSHA256 签名长度不一致 2022-01-01
- doFilter()是在servlet的工作完成之前还是之后执行的? 2022-01-01
- 将 Windows 证书导入 Java 2022-01-01
- 将 double 转换为 Int,向下舍入 2022-01-01
- 在springboot中如何给mybatis加拦截器 2023-04-29
- Maven:无效的目标版本:10 2022-01-01
