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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

maven 私服的使用及settings.xml的配置

發布時間:2025/3/21 编程问答 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 maven 私服的使用及settings.xml的配置 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

settings中的配置

1、映射阿里中央倉庫(下載jar包快一點)

<mirrors><mirror><id>alimaven</id><name>aliyun maven</name><url>http://maven.aliyun.com/nexus/content/groups/public/</url><mirrorOf>central</mirrorOf> </mirror> </mirrors>

2、配置本地倉庫(無需聯網使用jar包)

<localRepository>E:\maven_repository</localRepository>

3、登錄私服:

<server> <id>releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>snapshots</id> <username>admin</username> <password>admin123</password> </server>

4、在客戶端的 setting.xml 中配置私服的倉庫(用于本地項目依賴私服項目)

<profile> <!--profile 的 id--> <id>dev</id> <repositories> <repository> <!--倉庫 id,repositories 可以配置多個倉庫,保證 id 不重復--> <id>nexus</id> <!--倉庫地址,即 nexus 倉庫組的地址--> <url>http://localhost:8081/nexus/content/groups/public/</url> <!--是否下載 releases 構件--> <releases> <enabled>true</enabled> </releases> <!--是否下載 snapshots 構件--> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <!-- 插件倉庫,maven 的運行依賴插件,也需要從私服下載插件 --> <pluginRepository> <!-- 插件倉庫的 id 不允許重復,如果重復后邊配置會覆蓋前邊 --> <id>public</id> <name>Public Repositories</name> <url>http://localhost:8081/nexus/content/groups/public/</url> </pluginRepository> </pluginRepositories> </profile>

5、激活倉庫

<activeProfiles> <activeProfile>dev</activeProfile> </activeProfiles>

pom.xml配置(用于上傳項目到私服上)

<distributionManagement> <repository> <id>releases</id> <url>http://localhost:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>snapshots</id> <url>http://localhost:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>

私服的安裝NEXUS【了解】

一般公司早就有私服了。

《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀

總結

以上是生活随笔為你收集整理的maven 私服的使用及settings.xml的配置的全部內容,希望文章能夠幫你解決所遇到的問題。

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