最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

maven配置多個(gè)倉庫的實(shí)現(xiàn)

 更新時(shí)間:2023年01月16日 09:45:15   作者:sayyy  
本文主要介紹了maven配置多個(gè)倉庫的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

說明

maven的中央倉庫很強(qiáng)大,絕大多數(shù)的jar都收錄了。但也有未被收錄的。遇到未收錄的jar時(shí),就會(huì)編譯報(bào)錯(cuò)。
除了maven官方提供的倉庫之外,也有很多的倉庫。盡可能的將可信的倉庫(嗯,可信的倉庫?。┨砑訋讉€(gè),彌補(bǔ)maven官方倉庫的不足。

多倉庫配置方式一:全局多倉庫設(shè)置

全局多倉庫設(shè)置,是通過修改maven的setting文件實(shí)現(xiàn)的。

設(shè)置思路:在setting文件中添加多個(gè)profile(也可以在一個(gè)profile中包含很多個(gè)倉庫),并激活(即使是只有一個(gè)可用的profile,也需要激活)。

修改maven的setting文件,設(shè)置兩個(gè)倉庫(以此類推,可以添加多個(gè)):

? <profiles>
? ? <profile>
? ? ? ? <!-- id必須唯一 -->
? ? ? ? <id>myRepository1</id>
? ? ? ? <repositories>
? ? ? ? ? ? <repository>
? ? ? ? ? ? ? ? <!-- id必須唯一 -->
? ? ? ? ? ? ? ? <id>myRepository1_1</id>
? ? ? ? ? ? ? ? <!-- 倉庫的url地址 -->
? ? ? ? ? ? ? ? <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必須唯一 -->
? ? ? ? <id>myRepository2</id>
? ? ? ? <repositories>
? ? ? ? ? ? <repository>
? ? ? ? ? ? ? ? <!-- id必須唯一 -->
? ? ? ? ? ? ? ? <id>myRepository2_1</id>
? ? ? ? ? ? ? ? <!-- 倉庫的url地址 -->
? ? ? ? ? ? ? ? <url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
? ? ? ? ? ? ? ? <releases>
? ? ? ? ? ? ? ? ? ? <enabled>true</enabled>
? ? ? ? ? ? ? ? </releases>
? ? ? ? ? ? ? ? <snapshots>
? ? ? ? ? ? ? ? ? ? <enabled>true</enabled>
? ? ? ? ? ? ? ? ? ? <updatePolicy>always</updatePolicy>
? ? ? ? ? ? ? ? </snapshots>
? ? ? ? ? ? </repository>
? ? ? ? </repositories>
? ? </profile>
? </profiles>

? <activeProfiles>
? ? <!-- 激活myRepository1 -->
? ? <activeProfile>myRepository1</activeProfile>
? ? <!-- 激活myRepository2 -->
? ? <activeProfile>myRepository2</activeProfile>
? </activeProfiles>

多倉庫配置方式二:在項(xiàng)目中添加多個(gè)倉庫

在項(xiàng)目中添加多個(gè)倉庫,是通過修改項(xiàng)目中的pom文件實(shí)現(xiàn)的。

思路:在項(xiàng)目中pom文件的repositories節(jié)點(diǎn)(如果沒有手動(dòng)添加)下添加多個(gè)repository節(jié)點(diǎn),每個(gè)repository節(jié)點(diǎn)是一個(gè)倉庫。

修改項(xiàng)目中pom文件,設(shè)置兩個(gè)倉庫(以此類推,可以添加多個(gè)):

? ? <repositories>
? ? ? ? <repository>
? ? ? ? ? ? <!-- id必須唯一 -->
? ? ? ? ? ? <id>jboss-repository</id>
? ? ? ? ? ? <!-- 見名知意即可 -->
? ? ? ? ? ? <name>jboss repository</name>
? ? ? ? ? ? <!-- 倉庫的url地址 -->
? ? ? ? ? ? <url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
? ? ? ? </repository>
? ? ? ? <repository>
? ? ? ? ? ? <!-- id必須唯一 -->
? ? ? ? ? ? <id>aliyun-repository</id>
? ? ? ? ? ? <!-- 見名知意即可 -->
? ? ? ? ? ? <name>aliyun repository</name>
? ? ? ? ? ? <!-- 倉庫的url地址 -->
? ? ? ? ? ? <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
? ? ? ? </repository>
? ? </repositories>

注:以上兩種方式的id值均不可以為“central”。

到此這篇關(guān)于maven配置多個(gè)倉庫的實(shí)現(xiàn)的文章就介紹到這了,更多相關(guān)maven 多個(gè)倉庫內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論

郴州市| 长治市| 巴林右旗| 江西省| 灵璧县| 大关县| 鹤峰县| 峨眉山市| 始兴县| 兴海县| 乌鲁木齐县| 新龙县| 博客| 龙江县| 吴川市| 孝昌县| 长宁县| 夏邑县| 雅江县| 开封县| 玉林市| 广州市| 临清市| 肇庆市| 通海县| 盐亭县| 乃东县| 镇安县| 外汇| 麻栗坡县| 黄石市| 舞钢市| 哈巴河县| 车险| 定边县| 龙游县| 友谊县| 资兴市| 景东| 宽城| 定陶县|