MAVEN Specifies the warehouse location, specifying the remote warehouse
1. Specify the warehouse location (warehouse refers to the unified management location of the jar package required by the Java project)
Maven Location: D:\apache-maven-3.0.2
Default Warehouse Location C:\Users\Administrator\.m2\repository
Pre-specified location: C:\Program files\java\maven\repository
Open the "conf" file in the Maven location and open "Settings.xml" in the text editor to find
<settings xmlns= "http://maven.apache.org/SETTINGS/1.0.0"
Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"
xsi:schemalocation= "http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" >
Join in the next line above
<localrepository>c:\program files\java\maven\repository</localrepository>
When set, assign the current file (settings.xml) to "C:\Program files\java\maven\"
Added from Windows environment variables: m2_repo=C:\Program files\java\maven\repository, adding this variable to the PATH variable.
Eclipse settings
2. Specify a remote repository
In C:\Program files\java\maven\, open the settings.xml file with the editor
Add to
<mirrors> <mirror> <id>local-nexus</id> <name>maven Repository switchboard</name> <mirrorOf>*</mirrorOf> <url>http://xxx.xxx.xxx.xxx:xxxx/ nexus/content/groups/public/</url> </mirror></mirrors>
<profiles><profile> <id>nexus</id> <repositories> <repository> <id>nexus</id> <name>Nexus</name> <url>http://xxx.xxx.xxx.xxx:xxxx/ nexus/content/groups/public/</url> <releases> <enabled>true</enabled> < /releases> <snapshots> <enabled>true</enabled> </snapshots> < /repository> </repositories> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>Nexus</name> <url>http://xxx.xxx.xxx.xxx:xxxx/ nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles>
Java Mavn 2. Considerations