Maven存储库查找顺序
我们有一个基于Apache Archiva的内部存储库,并且已将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>
我想删除.m2/settings.xml文件.我想在我的pom.xml文件中定义它,这样,如果我的存储库管理器已启动并且正在运行,我希望运行时在那里进行连接,否则希望回退到其他存储库中.这可能吗?
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?
Maven 3.0已对其进行了修复,如下面的Maven开发人员的Jira所示.查找将按照声明的顺序完成.
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.