maven 配置多个仓库
生活随笔
收集整理的這篇文章主要介紹了
maven 配置多个仓库
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
之前在配置 Maven 的 settings.xml 時,都會設置 mirror 節點,例如:
<mirrors><mirror><id>alimaven</id><name>aliyun maven</name><url>http://maven.aliyun.com/nexus/content/groups/public/</url><mirrorOf>central</mirrorOf></mirror> </mirrors>然后第一想法就是在 mirrors 節點下多增加幾個 mirror,然而并不可以。正確的操作是在 profiles 節點下配置多個 profile,而且配置之后要激活。例如:
配置profiles
<profiles><profile> <id>boundlessgeo</id> <repositories> <repository> <id>boundlessgeo</id> <url>https://repo.boundlessgeo.com/main/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories> </profile> <profile> <id>aliyun</id> <repositories> <repository> <id>aliyun</id> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories> </profile> <profile> <id>maven-central</id> <repositories> <repository> <id>maven-central</id> <url>http://central.maven.org/maven2/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories> </profile> <profiles>通過配置 activeProfiles 子節點激活
<activeProfiles><activeProfile>boundlessgeo</activeProfile><activeProfile>aliyun</activeProfile><activeProfile>maven-central</activeProfile> </activeProfiles>如果在IDE里,記得要更新生效,然后就可以了。
?
?
轉自:https://my.oschina.net/u/3251146/blog/3002341
總結
以上是生活随笔為你收集整理的maven 配置多个仓库的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 多重免疫层析技术在产碳青霉烯酶肠杆菌科细
- 下一篇: 六级突击