Java Mavn 2. Precautions

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.