IDEA maven 項目如何上傳到私服倉庫

前言:idea maven 發佈版本到私服(快照和正式版)。我有個項目( jar 包源碼),其餘 maven 項目能直接引入依賴就最好了,因此必須將這個 jar 包源碼發佈到 maven 私服倉庫裏去。這裏記錄一下。html

1、發佈版本

<version>1.0-SNAPSHOT</version>

在 pom 文件中添加以下代碼:maven

    <!--發佈到私服: 設置 version 後,選擇 maven 的 deploy 命令-->
    <distributionManagement>
        <repository>
            <id>nexus</id>
            <name>nexus Repository RELEASES</name>
            <url>http://127.0.0.1:8081/nexus/content/repositories/releases/</url>
        </repository>
        <snapshotRepository>
            <id>nexus</id>
            <name>nexus Repository SNAPSHOTS</name>
            <url>http://127.0.0.1:8081/nexus/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

而後,idea maven 的 選擇設置好的 setting.xml 文件ide

 

最後,在 idea maven 中選擇 deploy 命令url

 

參考文檔:https://www.cnblogs.com/rwxwsblog/p/6029636.htmlidea

相關文章
相關標籤/搜索