Maven存储库查找顺序 [英] Maven repository lookup order

查看:101
本文介绍了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.

https://issues.apache.org/jira/browse/MNG-4400

这篇关于Maven存储库查找顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆