Change the value of M2_repo in Eclipse-reproduced

Source: Internet
Author: User

After adding MAVEN2 plug-ins from eclipse, the path to MAVEN's default local library is ${user}/.m2/repository/, and generally Windows users ' operating systems are installed on the C drive, so the jar packages in this directory are more dangerous. I tried to find M2_repo this variable from the Myeclipse->preferences->java->build path->classpath variables, and found that its path pointed to "c:/ Documents and settings/lvxda/.m2/repository/", I want to modify its path to: d:/m2/repository, but this variable edit button is gray, not editable. No corresponding solution has been found on the Internet. To try it yourself:

1, manually create the local warehouse address is: d:/m2/repository

2, added from the environment variable of Windows: M2_repo=d:/m2/repository, add this variable to the path variable at the same time.

3, modify the D:/maven/conf/setting.xml file, add a line under the <localRepository> node:

Code:<localrepository>d:/m2/repository</localrepository>

Indicates that the address of the local warehouse is: D:/m2/repository.

4. From myeclipse->preferences->maven->installations add a maven that has been installed on the D drive, such as: D:/maven, and tick this new add-on. and click on the browse button below to open MAVEN's global profile, such as: D:/maven/conf/setting.xml.

5. Modify the user setting option from Myeclipse->preferences->maven->installations to: d:/m2/repository/ Settings.xml, and click Update Settings. and click on the Reindex button below to update the index.

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

7, configuration changes, Myeclise will automatically update the index, when the completion of the restart MyEclipse, you will find the value of M2_repo variable becomes d:/m2/repository.

Since then, the jar packages that Maven downloads from the remote library will be placed under D:/m2/repository.

Reprint: http://blog.csdn.net/xuechongyang/article/details/8267440

Change the value of M2_repo in Eclipse-reproduced

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.