maven構建jar包發佈至私有倉庫(一)

使用場景:咱們想把咱們打的包放到私有云maven倉庫上面,能夠這麼作!apache

一、在須要發佈的工程pom文件,增長私服地址等相應的配置服務器

<!--  maven私服配置  -->
    <distributionManagement>
        <repository>
            <!-- nexus服務器中用戶名:在settings.xml中<server>的id-->    
            <id>maven-releases</id>
            <!-- 這個名稱本身定義 -->  
            <name>maven-releases</name>
            <url>http://192.168.32.90:8081/repository/maven-releases/</url>
        </repository>
       <!--快照
        <snapshotRepository>
            <id>maven-snapshots</id>
            <name>maven-snapshots</name>
            <url>http://192.168.32.90:8081/repository/maven-snapshots/</url>
        </snapshotRepository> -->
    </distributionManagement>

二、在apache maven環境settings修改配置,個人地址是:D:\apache-maven-3.3.9\conf\settings.xmlmaven

須要注意: < repository >節點下的< id >對應setting.xml文件中的server的idurl

<!--maven鏈接nexus須要驗證用戶名和密碼-->   
<server>
      <id>maven-releases</id>
      <username>admin</username>
      <password>Tanda123_*</password>
    </server>

三、點擊發布.net

四、發佈成功以後,能夠到私有庫中查看發佈的jar包文件3d

轉載: http://www.javashuo.com/article/p-cvrjfqsq-dp.htmlcode

相關文章
相關標籤/搜索