如何使 Maven 项目可供客户构建

发布于 2024-11-27 02:10:44 字数 575 浏览 0 评论 0 原文

我们有一个项目应该可以由客户使用 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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

葮薆情 2024-12-04 02:10:45

有两个选项:

  1. 准确记录哪些工件需要编译,哪些不需要编译
    可通过 Maven Central
  2. 实现 Nexus 并使用 Nexus 进行导出,给出导出
    给客户,他们需要导入它。我不知道
    如果您遇到许可证问题。

我假设您已经有了一个存储库管理器,但它看起来就像您没有一样。

There are two options:

  1. Document exactly what artifacts you need to compile which are not
    available via Maven Central
  2. Implement Nexus and make a export with Nexus give the export
    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.

情愿 2024-12-04 02:10:44

当然,托管某种类型的存储库是一个简单的选择,只要您可以满足正常运行时间/带宽/身份验证要求。

如果您希望运送物理工件,您会发现此模式很有帮助: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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文