使用Maven发布项目

发布项目:

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

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

配置pom.xml:

1.SCM。

<scm>
	<connection>scm:svn:http://*/repos/*/trunk</connection>
	<developerConnection>scm:svn:http://*/repos/*/trunk/</developerConnection>
</scm>
 

2.maven-release-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。

<server>    
      <id>http://*/</id>    
      <username>**</username>    
      <password>**</password>    
</server>   

 

4.命令

更新版本号,打标签。

mvn release:prepare

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

mvn release:perform

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

mvn deploy
 

猜你喜欢

转载自xc5.iteye.com/blog/1520198