Maven import dependency is very slow under IDEA

Maven import dependency under IDEA is very slow. The solution. Recently, after reinstalling IDEA, whether it is creating or importing a project, the speed of downloading the corresponding package when pom.xml introduces dependency is very slow. This is because the default is foreign For mirroring, you need to manually configure Maven's settings.xml and modify it to a domestic mirror. I myself sometimes

Step 1: Find the configuration file

Generally, you just installed IDEA without this settings.xml, you need to create it. First, click the right mouse button on pom.xml, find Maven at the bottom, and then select create settings.xml (if you have already created it, open settings.xml)Insert picture description here

Step 2: Modify the configuration settings.xml

After creating or opening settings.xml, modify the content to the following, and replace it with the domestic Alibaba Cloud mirror

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <mirrors>
        <mirror>
            <id>alimaven</id>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
        <mirror>
            <id>uk</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://uk.maven.org/maven2/</url>
        </mirror>
        <mirror>
            <id>CN</id>
            <name>OSChina Central</name>
            <url>http://maven.oschina.net/content/groups/public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
        <mirror>
            <id>nexus</id>
            <name>internal nexus repository</name>
            <url>http://repo.maven.apache.org/maven2</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
    </mirrors>
</settings>

Step 3: Restart IDEA and import dependencies

Guess you like

Origin blog.csdn.net/weixin_45925906/article/details/112795611