Maven 存储库查找顺序
我们有一个基于 Apache Archiva 的内部存储库,并且我们在 pom.xml 中配置了存储库标签,如下所示。我是否可以假设,如果您有权访问内部存储库,所有依赖项访问都将由内部存储库解析,并且如果内部存储库因某种原因关闭,则所有依赖项访问将由下面列出的其他存储库解析。
<repositories>
<repository>
<id>internal</id>
<name>Internal Repository</name>
<url>http://192.168.1.2/archiva/repository/internal</url>
</repository>
<repository>
<id>jboss</id>
<url>https://repository.jboss.org/nexus/content/repositories/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
....
</repositories>
编辑:
我想删除 .m2/settings.xml 文件。我想在我的 pom.xml 文件中定义它,这样如果我的存储库管理器已启动并正在运行,我将希望运行时连接到那里,否则将希望回退到其他存储库。这可能吗?
We have an internal Apache Archiva based repository and we have configured the repositories tag in pom.xml to be as follows. Can I assume that all dependency access will get resolved by internal repository if you have access to it and will get resolved by other repositories listed below, if internal repository is down for a certain reason.
<repositories>
<repository>
<id>internal</id>
<name>Internal Repository</name>
<url>http://192.168.1.2/archiva/repository/internal</url>
</repository>
<repository>
<id>jboss</id>
<url>https://repository.jboss.org/nexus/content/repositories/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
....
</repositories>
EDIT:
I want to do away with the .m2/settings.xml file. I want to define this in my pom.xml file, so that if my repository manager is UP and running I would want the runtime to connect there, else would want to fallback into the other repositories. Would this be possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Maven 3.0 已修复此问题,您可以在下面的 Maven 开发人员的 Jira 中看到。查找将按照声明的顺序完成。
https://issues.apache.org/jira/browse/MNG-4400
Maven 3.0 had it fixed as you can see in Maven developer's Jira below. The lookup will be done in the order they are declared.
https://issues.apache.org/jira/browse/MNG-4400