nexus搭建maven私服

參考:https://blog.csdn.net/sinat_35210614/article/details/130406060

下載、安裝、啟動nexus

nexus創(chuàng)建用戶和角色

maven配置

修改maven的setting.xml配置,要和剛才創(chuàng)建的用戶名,密碼一致,倉庫id不要去修改

    <server>
      <id>nexus-releases</id>
      <username>user</username>
      <password>123456</password>
    </server>
    <server>
      <id>nexus-snapshots</id>
      <username>user</username>
      <password>123456</password>
    </server>

改造父工程的pom.xml

在要使用內(nèi)部jar包項目的maven父工程的pom.xml文件中加入

    <distributionManagement>
        <repository>
            <id>nexus-releases</id>
            <url>http://ip:port/repository/maven-releases</url>
        </repository>
        <snapshotRepository>
            <id>nexus-snapshots</id>
            <url>http://ip:port/repository/maven-snapshots</url>
        </snapshotRepository>
    </distributionManagement>

上傳私有jar包

找到你想打成依賴的項目,執(zhí)行以下命令

mvn clean
mvn deploy
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容