我们有一个项目应该可以由客户使用 Maven 构建。它有一些已mavenized(没问题)的开源依赖项,一些未mavenized的,专有的东西(oracle jdbc驱动程序)和一些内部的东西。
到目前为止,我们已经将除第一个类别之外的所有内容与项目本身一起打包在本地存储库中(在项目 pom.xml 中指定了 file://path-in-project-folder 的存储库)。
我们很乐意将它们移出项目,因为我们也将在其他项目中使用它们。目前我们计划使用 Nexus 作为内部 Maven 存储库。
向客户提供此类依赖项/maven 存储库以便他可以继续构建项目的最佳实践是什么?
到目前为止的想法:
- 客户还设置了一个 Nexus 存储库,我们以某种方式将所有这些非公共依赖项部署到他的存储库(就像镜子一样)
- 我们提供非公共依赖项的“哑”转储/快照,客户添加此快照将此 settings.xml 作为存储库(但这怎么可能)。
- 使我们的内部 Nexus 存储库可供客户构建服务器使用(在我们的案例中不是一个选项)
我想知道其他人如何解决这些问题。
谢谢你!
We have a project which should be buildable by the customer using maven. It has some open source dependencies that are mavenized (no problem), some that aren't mavenized, proprietary stuff (oracle jdbc driver) and some internal stuff.
Until now we had everything but the first category packaged with the project itself in a local repository (repository with file://path-in-project-folder specified in the projects pom.xml).
We would love to move these out of the project, as we are about to use them in other projects as well. Currently we plan to use nexus as an internal maven repository.
Whats the best practice to make such dependencies/maven repositories available to the customer so he can continue to build the project.
Ideas so far:
- Customer sets up a nexus repository as well, we somehow deploy all these non-public dependencies to his repository (like a mirror)
- We provide a 'dumb' dump/snapshot of the non-public dependencies, customer adds this snapshot to this settings.xml as a repository, (but how is this possible).
- Make our internal nexus repo available to the customers build server (not an option in our case)
I'm wondering how others solve these problems.
Thank you!
发布评论
评论(2)
有两个选项:
可通过 Maven Central
给客户,他们需要导入它。我不知道
如果您遇到许可证问题。
我假设您已经有了一个存储库管理器,但它看起来就像您没有一样。
There are two options:
available via Maven Central
to customer and they need to do a import of it. I'm not sure
if you come to licenses issues.
I assumed that you already have a Repository Manager already but it reads like you didn't.
当然,托管某种类型的存储库是一个简单的选择,只要您可以满足正常运行时间/带宽/身份验证要求。
如果您希望运送物理工件,您会发现此模式很有帮助:https://brettporter.wordpress.com/2009/06/10/a-maven-friend-pattern-for-storing-dependency-in-version-control/
这依赖于在源代码管理中创建存储库 - 如果您希望项目构建存储库,请考虑以下内容: http://svn.apache.org/viewvc/incubator/npanday/trunk/dist/npanday-repository-builder/pom.xml?revision=1139488&view=markup(使用程序集插件构建存储库的能力)。
基本上,通过构建存储库,您可以将其与源代码一起发送,并使用 file:// 从构建中引用它。
Of course, hosting a repository of some kind is a straightforward option, as long as you can cover the uptime / bandwidth / authentication requirements.
If you're looking to ship physical artifacts, you'll find this pattern helpful: https://brettporter.wordpress.com/2009/06/10/a-maven-friendly-pattern-for-storing-dependencies-in-version-control/
That relies on the repository being created in source control - if you want a project to build a repository, consider something like: http://svn.apache.org/viewvc/incubator/npanday/trunk/dist/npanday-repository-builder/pom.xml?revision=1139488&view=markup (using the assembly plugin's capability to build a repository).
Basically, by building a repository you can ship that with the source code and use file:// to reference it from within the build.