After adding the Maven2 plugin from Eclipse, the path to MAVEN's default local library is ${user}/.m2/repository/ , and the general Windows user's operating system is installed on the C drive. So the jar package under this directory is more dangerous. I tried to find the M2_repo variable from the myeclipse->preferences->java->build path->classpath variables , and found that its path pointed to the "C:\Documents and Settings\lvxda\.m2\repository\", I want to modify its path to:d:\m2\repository, but this variable's 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:
Copy the contents to the Clipboard,
Code:<localRepository>d:/m2/repository</localRepository>
Represents the address of the local warehouse:d:/m2/repository
4. From myeclipse->preferences->maven->installations add a maven already installed to 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 . To avoid downloading jars from a remote repository every time the build system is built, you need to set up a.
[Go] Modify MAVEN local warehouse path