日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

maven 配置多个仓库

發布時間:2023/12/20 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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 配置多个仓库的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。