Modify the MAVEN default local repository

Source: Internet
Author: User
1. The default local warehouse

Under the current user directory of the system. M2

The MAVEN default local warehouse path is ${user.home}/.m2/repository.

A local repository is a buffer and a subset of remote repositories, and when you build a MAVEN project, you first look for resources from the local repository, and if not, MAVEN downloads from the remote repository to your local repository. This will not need to be downloaded from a remote location the next time you use it. If the jar package version you need is not in the local repository and does not exist in the remote repository, MAVEN will report an error when it is built, which may be that some new versions of the jar packages are not updated in the MAVEN repository.

2. Modify the local creation library

New M2\repository folder under D drive

You can configure the local warehouse path by modifying ${user.home}/.m2/settings.xml

To modify the Setting.xml file in the conf/folder under the MAVEN installation directory, add a new line:

<localRepository>D:\m2\repository</localRepository>

(indicates the address of the local warehouse is: D:\m2\repository)

Copy the Setting.xml to

Under the D:\m2\repository directory

3. Modify the MAVEN configuration in Eclipse

Modify the configuration information for Maven in MyEclipse.

1. Open Eclipse Click Windows->preferences->maven->installations Add a maven that is already installed in the D:\maven\ directory, such as: D:\maven\ apache-maven-3.3.3, and tick this new add-on. and click on the browse button below to open MAVEN's global profile, such as: D:\maven\apache-maven-3.3.3\conf\setting.xml.

2. Open MyEclipse Click Windows->preferences->maven->user Setting the Modify User setting option is: D:\m2\repository\ Settings.xml, and click Update Settings. and click on the Reindex button below to update the index.

3. Click the Apply button in the Configuration window to highlight the configuration window.

4. Update the Local warehouse

Finally open cmd, execute
mvn help:system
will find maven downloaded from the Remote Library jar package will be placed in the newly modified path

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.