IDEA Maven can not be downloaded to solve the dependency problem

Before IDEA used Maven to download dependencies, there was no problem. Later, it suddenly appeared that Maven could not download dependencies. I went to the Internet to check it because the Maven warehouses abroad are not available and need to be changed to Ali's warehouse configuration.

The first step is to find the settings.xml file of Maven.

There are two ways to find the settings.xml file.

The first method, in IDEA, right-click the pom.xml file-> Maven-> Open 'Settings.xml'

The second method is to open the directory where Maven is located C:> users> administrator> .m2

The second step is to change the Maven warehouse to the Alibaba Cloud warehouse

The configuration code is as follows:

<mirrors>
    <mirror>
        <id>alimaven</id>
        <name>aliyun maven</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
</mirrors>

The third step is to update the Maven configuration of IDEA

file-> settings-> maven-> Check User settings file: Override checkbox behind-> OK

Published 34 original articles · Like1 · Visits 1945

Guess you like

Origin blog.csdn.net/qq_38974638/article/details/104991554