How to build dubbox and deploy to nexus server

来自koorka知识分享
跳转至: 导航搜索

Go to https://github.com/dangdangdotcom/dubbox download the source code.

Check the local maven settings.xml file , look out the <Servers> tag items. More details, please refer to Maven Setting Reference
<settings>
<!-- Server example -->
 <servers>
     <server>
       <id>releases</id>
       <username>deployment</username>
       <password>deployment</password>
     </server>
 </servers>
</settings>
Edit the top pom.xml of source code or maven setting file settings.xml, Add the <distributionManagement> setting.
<project>

<distributionManagement>
    <repository>
<!-- The id value is the server tag id value of settings.xml-->
        <id>releases</id>
        <name>dubbo-2.8.4 releases</name>
        <url>http://172.28.3.60:8081/nexus/content/repositories/thirdparty/</url>
    </repository>
</distributionManagement>

</project>
Find all pom.xml and setting maven.deploy.skip as false . that means <skip_maven_deploy>false</skip_maven_deploy>
# For Mac OS
find ~/project/dubbox-dubbox-2.8.4 -type f -name 'pom.xml'  -exec sed -i '' 's/<skip_maven_deploy>true<\/skip_maven_deploy>/<skip_maven_deploy>false<\/skip_maven_deploy>/g' {} \;

# For Linux 
find ~/project/dubbox-dubbox-2.8.4 -type f -name 'pom.xml'  -exec sed -i  's/<skip_maven_deploy>true<\/skip_maven_deploy>/<skip_maven_deploy>false<\/skip_maven_deploy>/g' {} \;
compile and deploy dubbox to nexus sever:
mvn clean deploy -Dmaven.test.skip=true
When mvn command is successful, you will find the directory tree like this on nexus:
Dubbox application packages and libs on nexus.png