dubbo-2.8.4編譯發佈到本地Nexus庫

首先修改本地Maven的settings.xml文件,注意<Servers>標籤中的內容:apache

<settings xmlns="http://maven.apache.org/POM/4.0.0"  
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0  
                               http://maven.apache.org/xsd/settings-1.0.0.xsd">  
 <mirrors>
    <mirror>
      <id>CN</id>
      <name>OSChina Central</name>                                                                                                                       
      <url>http://maven.oschina.net/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>
    </mirror>
  </mirrors>
  
  <localRepository>D:\Java\m2\repository</localRepository>
 <servers>
     <server>
       <id>releases</id>
       <username>deployment</username>
       <password>deployment</password>
     </server>
 </servers>
</settings>

 

dubbo-master頂層配置文件:服務器

image

<distributionManagement>
   <repository>
    <id>releases</id>
    <name>dubbo-2.8.4 releases</name>
    <url>http://172.28.3.60:8081/nexus/content/repositories/releases/</url>
   </repository>
  </distributionManagement>

 

在Nexus中設置deployment帳戶的用戶名和密碼:maven

image

 

在repository中設置,repository能夠:Allow Redeploy:url

image

 

 

 

在dubbo-master的頂層目錄執行:mvn deploy –Dmaven.test.skip=true:spa

image

 

 

執行完畢後,能夠在本地的庫中看到dubbo被成功的發佈到了公司內部的mavne服務器:.net

image

 

使用者只須要在本身的pom文件中,添加以下配置便可:code

<repositories>
  <!--
   <repository> <id>thirdparty</id> <url>http://172.28.3.60:8081/nexus/content/repositories/thirdparty</url> 
   </repository> 
   -->
   <repository>
   <id>releases</id>
   <url>http://172.28.3.60:8081/nexus/content/repositories/releases</url>
   </repository>
 </repositories>
相關文章
相關標籤/搜索