Maven Remote Repository Configuration Experience Notes

  • Download the dependency jar:

 In MAVEN_HOME\setting.xml, you can configure

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

In the project's pom.xml, configure

	<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>

 Because uploading requires a password,

Also in maven_home\setting.xml, with password

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

 Note that the id here is the same as the one in the previous pom.

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326181712&siteId=291194637