http://jacky2007.iteye.com/blog/354387
nexus中的设置就不说了
首先要在pom.xml中添加
- <distributionManagement>
- <repository>
- <id>releases</id>
- <name>Internal Releases</name>
- <url>http://localhost:8081/nexus/content/repositories/thirdparty</url>
- </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中添加
-
- <server>
- <id>http://*/</id>
- <username>**</username>
- <password>**</password>
- </server>
mvn deploy
顺利部署...
============
http://xc5.iteye.com/blog/1520198
发布项目:
升级本地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>
<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>
<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>
<server>
<id>http://*/</id>
<username>**</username>
<password>**</password>
</server>
4.命令
更新版本号,打标签。
- mvn release:prepare
mvn release:prepare
checkout发布版本标签内容,打包上传到release服务器。
- mvn release:perform
mvn release:perform
将当前snapshot版本发布到snapshot服务器。
- mvn deploy