maven modifies remote and local repository addresses

Find the maven installation location -> setting.xml under conf,

Such as: D:\Program Files\apache-maven-3.5.3\conf\setting.xml, open it

Modify the remote repository:

<mirrors>
  <mirror>
    //id of the image
    <id>nexus-aliyun</id>
    //The mirror is used to replace the remote warehouse, central is the id of the central warehouse
    <mirrorOf>central</mirrorOf>
    <name>Nexus aliyun</name>
    //The warehouse address of the image, here is the warehouse of Ali used
    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
  </mirror>
</mirrors>

Modify the local repository:

1. Create a new local warehouse folder: D:\Program Files\maven-repository

2. Open D:\Program Files\apache-maven-3.5.3\conf\setting.xml, find the localRepository node, and add the location of the local warehouse you want to put below

<localRepository>D:\Program Files\maven-repository</localRepository>

3. Copy D:\Program Files\apache-maven-3.5.3\conf\setting.xml to: D:\Program Files\maven-repository

4. After the configuration is completed, open intellij idea, open file->setting, search for maven: modify the following 3 locations

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324494067&siteId=291194637