Maven training

1.一般情况下,在settings.xml不配mirror可能更好,找不到jar它会一个个去相应的 repository里找. 只有你不想让你的项目从remote repository去search 和download jar,你可以配一个mirror映射到你想让它去search和download的repository.
<mirrors>
</mirrors>

2.(忘了讲)当多个profiles被激活, download jar的repository顺序是定义时的profile反序。For example:
<profiles>
<profile>
<id>CMWRepository</id>
<repositories>
<repository>
<url>http://jabdw3422:8181/nexus/content/groups/public/</url>
</repository>
</repositories>
</profile>

<profile>
<id>jenkins</id>
<repositories>
<repository>
<url>http://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
</profile>
</profiles>


当上面两个profile都被激活时,search 和 download jar包的repository顺序先http://repo.jenkins-ci.org/public/, 再http://jabdw3422:8181/nexus/content/groups/public/. 跟Profile定义的顺序是相反的。

3. 最有效的检查dependency jar从哪个repository search和download顺序是看Effective POM.xml的repositories。注意,不包括maven plugin jar下载, maven plugin jar从哪个repository search和download顺序看Effective POM.xml的pluginRepositories.

4.在不同的环境下支持多个version, 比如dev需要2.x.x, qa需要1.x.x.
<Import-Package>
...
com.ssc.ssgm.fx.ffo.services.*;version="(0,10]",
...
</Import-Package>

<dependency>
<groupId>com.ssc.ssgm.fx.ffo</groupId>
<artifactId>ffo-ref-data-retrieve-bundle</artifactId>
<version>(0,10]</version>
<scope>provided</scope>
</dependency>


5. mirror是镜像, 而不是“分库”, 只有当前一个mirror无法连接的时候,才会去找后一个,类似于备份和容灾.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值