生活随笔
收集整理的這篇文章主要介紹了
maven 中 部署构件至Nexus(mvn deploy)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
http://jacky2007.iteye.com/blog/354387
nexus中的設置就不說了
?
首先要在pom.xml中添加
?
Java代碼 ?
<distributionManagement> ?????<repository> ???????<id>releases</id> ???????<name>Internal?Releases</name> ???????<url>http:?????</repository> ???</distributionManagement>??
<distributionManagement><repository><id>releases</id><name>Internal Releases</name><url>http://localhost:8081/nexus/content/repositories/thirdparty</url></repository></distributionManagement>
?這時如果 進行deploy時返回
?Return code is: 401
?錯誤
?則需要進行用戶驗證
需要在settings.xml的servers中添加
Java代碼
<server>???? ????????<id>http:????????<username>**</username>???? ????????<password>**</password>???? ??</server>???????
mvn deploy
順利部署...
?
============
http://xc5.iteye.com/blog/1520198
發(fā)布項目:
升級本地snapshot版本,在svn創(chuàng)建標簽,向release服務器提交發(fā)布包、docs等。
如果版本為snapshot,使用mvn deploy發(fā)布當前版本到snapshot庫。
配置pom.xml:
1.SCM。
Java代碼 ?
<scm> ??????<connection>scm:svn:http:??????<developerConnection>scm:svn:http:??</scm>??
<scm><connection>scm:svn:http://*/repos/*/trunk</connection><developerConnection>scm:svn:http://*/repos/*/trunk/</developerConnection>
</scm>
?
2.maven-release-plugin。
Java代碼 ?
<plugin> ??????<groupId>org.apache.maven.plugins</groupId> ??????<artifactId>maven-release-plugin</artifactId> ??????<configuration> ??????????<tagBase>http:??????</configuration> ??</plugin>??
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-release-plugin</artifactId><configuration><tagBase>http://*/repos/*/tags/</tagBase></configuration>
</plugin>
?
3.修改settings.xml,設置svn密碼。id=maven-release-plugin.tagBase。
Java代碼 ?
<server>???? ????????<id>http:????????<username>**</username>???? ????????<password>**</password>???? ??</server>?????
<server> <id>http://*/</id> <username>**</username> <password>**</password>
</server>
?
4.命令
更新版本號,打標簽。
Java代碼 ?
mvn?release:prepare??
mvn release:prepare
?checkout發(fā)布版本標簽內容,打包上傳到release服務器。
Java代碼 ?
mvn?release:perform??
mvn release:perform
?將當前snapshot版本發(fā)布到snapshot服務器。
Java代碼 ?
mvn?deploy??
?
?
總結
以上是生活随笔為你收集整理的maven 中 部署构件至Nexus(mvn deploy)的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。