maven远程资源库配置经验记

  • 下载依赖jar:

 在MAVEN_HOME\setting.xml中,配置即可

	 <mirror>     
       <id>nexus</id>     
       <mirrorOf>*</mirrorOf>     
       <url>http://devmap:8081/nexus/content/groups/public/</url>     
     </mirror> 
  •  上传 jar:

在项目的pom.xml,配置

	<distributionManagement>
		<repository>
			<id>releases</id>
			<name>Internal Releases</name>
			<url>http://devmap:8081/nexus/content/repositories/releases</url>
		</repository>
		<snapshotRepository>
			<id>snapshots</id>
			<name>Internal Snapshots</name>
			<url>http://devmap:8081/nexus/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>

 因为上传需要密码,

还要在maven_home\setting.xml,配密码

    <server>    
       <id>snapshots</id>    
       <username>deployment</username>    
       <password>deployment123</password>    
	</server> 

 注意,这里的id和前面pom里的一致。

猜你喜欢

转载自xinglijun1973.iteye.com/blog/2412990
今日推荐