Nexus 团体订购

发布于 2024-10-31 08:30:17 字数 747 浏览 3 评论 0原文

我们使用 Nexus 作为存储库管理系统。然而,我们在管理团队方面遇到了问题。

基本上,我们有一个快照版本化工件,位于两个存储库中。我们按照我们希望 Nexus 搜索它们的顺序将这两个存储库添加到同一组中。这是根据文档: http:// /www.sonatype.com/books/nexus-book/reference/config-sect-managing-groups.html

group
    ...
    --> repo1
            ...
            --> com.test.example-1.0.0-SNAPSHOT
            ...
    --> repo2
            ...
            --> com.test.example-1.0.0-SNAPSHOT         
            ...
    ...

因此,通过将 repo1 排序在 repo2 之上,我们总是希望从 repo1 下载示例工件。然而,我们在现实中发现,尽管有订购,我们总是从任一存储库下载最新的快照版本。因此,如果 repo2 有更新的快照版本,我们会将其删除。

还有其他人看到过这种行为吗? Nexus 不考虑快照存储库的排序吗?

We are using nexus as a repository management system. However we are encountering a problem in regards to managing our groups.

Basically we have an snapshot versioned artifact that lives in two repositories. We add both these repositories to the same group in the order that we would like nexus to search them. This is in accordance with the documentation: http://www.sonatype.com/books/nexus-book/reference/config-sect-managing-groups.html

group
    ...
    --> repo1
            ...
            --> com.test.example-1.0.0-SNAPSHOT
            ...
    --> repo2
            ...
            --> com.test.example-1.0.0-SNAPSHOT         
            ...
    ...

So by ordering repo1 above repo2 we always want to download the example artifact from repo1. What we find in reality however is that despite the ordering, we always download the latest snapshot version from either repo. So if repo2 has a more recent snapshot version we are pulling it down.

Has anyone else seen this behaviour? Does nexus not take ordering into account with snapshot repositories?

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

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

发布评论

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

评论(1

贪恋 2024-11-07 08:30:17

这实际上不是 Nexus,而是 Maven 执行的,会发生什么:

  • Maven 从 Nexus 请求“maven-metatadata.xml”,
  • Nexus 按给定顺序循环遍历成员存储库(repo1、repo2...)并合并该 XML 文件。
  • 从合并的 XML 中,Maven“获取最新快照的知识”,并明确要求它。
  • Nexus 不能做任何事情,我敢打赌你的快照有不同的名称(artifactId-1.0-yyyy.mm.dd.hh.mm.jar,但这两个可能有不同的 yyymmdd 等),并提供 Maven 要求的

内容在这里让 Nexus 从 Maven 中“隐藏”东西就是路由规则。添加一条规则,使给定的 groupId、artifactId 或其他内容(实际上是正则表达式)仅从 repo1 提供服务。

This is actually not Nexus but Maven that does it, what happens:

  • Maven requests "maven-metatadata.xml" from Nexus
  • Nexus cycles over member repositories in given order (repo1, repo2...) and merges that XML files.
  • From merged XML, Maven "gets the knowledge" of the latest snapshot, and explicitly asks for it.
  • Nexus can't do anything, I bet your snapshots has different names (artifactId-1.0-yyyy.mm.dd.hh.mm.jar, but those two has probably different yyymmdd etc), and serves up what Maven asks

What you can do here to make Nexus "hide" stuff from Maven is Routing rules. Add a rule that for given groupId, or artifactId or whatever (it's actually a regexp) serve only from repo1.

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