maven 获取jar从不同的仓库搜寻排序

maven仓库读取备忘录:
在setting.xml配置了镜像后首先读取镜像的仓库,在没有对应的仓库id,读取setting.xml下标签<profile>下的仓库id,如果没有相对应url或者jar, 再读取项目下
pom.xml下标签<repositories>下的仓库,如果没有相对应的url或者jar,在读取maven默认的中央仓库,如果没有就报错了!

maven 项目下 pom.xml配置仓库

<repositories>
<repository>
<id>test</id>
<url>http://192.168.0.114:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>


maven setting.xml下<profile>标签配置
<profile> 
<id>dev</id>
<repositories>
<repository>
<id>testrepositoryok</id>
<name>Repository for JDK 1.4 builds</name>
<url>http://192.168.0.114:8081/nexus123/content/groups/public/</url>
<layout>default</layout>
<snapshotPolicy>always</snapshotPolicy>
</repository>
</repositories>
</profile>
激活<activeProfiles>
<activeProfile>dev</activeProfile>
</activeProfiles>


maven setting.xml下<profile>标签配置
<mirrors> 
<mirror>
<id>mirrorId</id>
<mirrorOf>testrepositoryok1</mirrorOf>
<name>newtec xxh Mirror</name>
<url>http://192.168.0.114:8081/nexus/content/groups/public/</url>
</mirror>
</mirrors>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值