【IDEA】Maven项目pom.xml依赖包下载太慢

pom.xml文件依赖包下载过慢

解决方法

配置国内阿里的镜像地址,速度飞起~~

1、打开/创建 settings.xml

鼠标右键点击 项目(或 pom.xml文件)如下图所示打开或创建 settings.xml。
在这里插入图片描述

2、给settings.xml添加配置

通过settings.xml配置国内阿里的镜像地址,settings.xml文件内容如下:

<?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>

3、重启 IDEA ,KO

猜你喜欢

转载自blog.csdn.net/weixin_40849588/article/details/100146822
今日推荐