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

nexus中的设置就不说了

首先要在pom.xml中添加

<distributionManagement>
	<repository>
	<id>xxtuanRelease</id>
	<name>Local Nexus Repository</name>
	<url>http://10.96.234.123:8081/nexus/content/repositories/releases</url>
	</repository>
	<snapshotRepository>
	<id>xxtuanSnapshot</id>
	<name>Local Nexus Repository</name>
	<url>http://10.96.234.123:8081/nexus/content/repositories/snapshots</url>
	</snapshotRepository>
</distributionManagement>

这时如果 进行deploy时返回

 Return code is: 401

 错误

 则需要进行用户验证

需要在settings.xml的servers中添加

    <server>  
       <id>xxtuanRelease</id>  
       <username>repouser</username>  
       <password>repopwd</password>  
     </server>  

mvn deploy

顺利部署..

猜你喜欢

转载自longzhun.iteye.com/blog/1727684