maven之私服配置deploy及上传命令

maven deploy
http://www.blogjava.net/libin2722/articles/332876.html

maven setting.xml文件
http://www.360doc.com/content/12/0403/14/834950_200481342.shtml

【第一种】pom.xml配置
pom.xml的配置,部署的路径
     <distributionManagement>
          <repository>
               <id>nexus</id>
               <name>releases</name>
               <url>http://nexus.mgt.pangu365.com/content/repositories/releases</url>
          </repository>
          <snapshotRepository>
               <id>nexus</id>
               <name>releases</name>
               <url>http://nexus.mgt.pangu365.com/content/repositories/snapshots</url>
               <uniqueVersion>false</uniqueVersion>
          </snapshotRepository>
     </distributionManagement> 
    <repositories>       
        <repository>
            <id>Nexus</id>
            <name>Nexus Public Repository</name>
            <url>http://nexus.mgt.pangu365.com/content/groups/public/</url>
        </repository>  
    </repositories>

【第二种】{m2_home}/conf/setting.xml配置
setting.xml
  <servers>
     <!-- id就是库的ID -DrepositoryId-->
     <!--
     <server>
            <id>nexus</id>
            <username>deployment</username>
            <password>deployment123</password>
     </server>
     -->
  </servers>

  <mirrors>
     <!--
     此行不配置,写在pom中也可以
     <mirror>
        <id>nexus</id>
        <mirrorOf> * </mirrorOf>
        <url>http://nexus.mgt.pangu365.com/content/groups/public/</url>
    </mirror>   
     -->
  </mirrors>

【deploy命令】
mvn deploy:deploy-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/application/search/tools-1.4.2.jar -Durl=http://nexus.mgt.pangu365.com/content/repositories/thirdparty -DrepositoryId=nexus -X

其中-DrepositoryId=nexus就是服务器中 ${M2_HOME}/conf/setting.xml中,配置用户名密码的id

猜你喜欢

转载自phl.iteye.com/blog/1982674
今日推荐