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