maven 中 部署构件至Nexus(mvn deploy)

http://jacky2007.iteye.com/blog/354387

nexus中的设置就不说了

 

首先要在pom.xml中添加

 

Java代码 复制代码  收藏代码
  1. <distributionManagement>   
  2.    <repository>   
  3.      <id>releases</id>   
  4.      <name>Internal Releases</name>   
  5.      <url>http://localhost:8081/nexus/content/repositories/thirdparty</url>   
  6.    </repository>   
  7.  </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代码
    1. <server>       
    2.       <id>http://*/</id>       
    3.       <username>**</username>       
    4.       <password>**</password>       
    5. </server>     
       
       

mvn deploy

顺利部署...

 

============

http://xc5.iteye.com/blog/1520198

发布项目:

升级本地snapshot版本,在svn创建标签,向release服务器提交发布包、docs等。

如果版本为snapshot,使用mvn deploy发布当前版本到snapshot库。

配置pom.xml:

1.SCM。

Java代码 复制代码  收藏代码
  1. <scm>   
  2.     <connection>scm:svn:http://*/repos/*/trunk</connection>   
  3.     <developerConnection>scm:svn:http://*/repos/*/trunk/</developerConnection>   
  4. </scm>  
<scm>
	<connection>scm:svn:http://*/repos/*/trunk</connection>
	<developerConnection>scm:svn:http://*/repos/*/trunk/</developerConnection>
</scm>

 

2.maven-release-plugin。

Java代码 复制代码  收藏代码
  1. <plugin>   
  2.     <groupId>org.apache.maven.plugins</groupId>   
  3.     <artifactId>maven-release-plugin</artifactId>   
  4.     <configuration>   
  5.         <tagBase>http://*/repos/*/tags/</tagBase>   
  6.     </configuration>   
  7. </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代码 复制代码  收藏代码
  1. <server>       
  2.       <id>http://*/</id>       
  3.       <username>**</username>       
  4.       <password>**</password>       
  5. </server>     
<server>    
      <id>http://*/</id>    
      <username>**</username>    
      <password>**</password>    
</server>   

 

4.命令

更新版本号,打标签。

Java代码 复制代码  收藏代码
  1. mvn release:prepare  
mvn release:prepare

 checkout发布版本标签内容,打包上传到release服务器。

Java代码 复制代码  收藏代码
  1. mvn release:perform  
mvn release:perform

 将当前snapshot版本发布到snapshot服务器。

Java代码 复制代码  收藏代码
  1. mvn deploy  

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值