maven安装到私服和从私服下载
生活随笔
收集整理的這篇文章主要介紹了
maven安装到私服和从私服下载
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
settings文件標簽下,使安裝的maven能夠登錄到nexus私服
<server><id>releases</id><username>admin</username><password>admin123</password> </server><server><id>snapshots</id><username>admin</username><password>admin123</password> </server>pom文件標簽下,執行maven生命周期最后一個方法deploy,會將項目打包上傳到私服,前提上setting中已經配置了servers標簽的內容
<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>settings文件標簽下,run時當本地倉庫沒有時,會自動從私服搜尋項目的依賴
<!-- 下載jar包配置 --><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>激活profiles的配置
<activeProfiles><activeProfile>dev</activeProfile> </activeProfiles>總結
以上是生活随笔為你收集整理的maven安装到私服和从私服下载的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux 安装字体 注册表,如何安装字
- 下一篇: 解决Anaconda环境未激活的warn