Maven镜像仓库更换为阿里云,快速加载依赖

总共修改两个地方, 一个settings.xml配置文件, 一个 pom.xml 文件.

修改maven配置文件settings.xml (当然也可以在用户home目录.m2下面添加一个settings.xml文件,记得备份.)

在 apache-maven-3.x.x/conf 目录下.

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

扫描二维码关注公众号,回复: 5428297 查看本文章

设置 idea

二.更改项目的pom.xml配置文件, 重新导入即可


<repositories>
        <repository>
            <id>nexus-aliyun</id>
            <name>Nexus aliyun</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
        </repository>
</repositories>
 

猜你喜欢

转载自blog.csdn.net/zhanglong_4444/article/details/88069467