第一步:右键项目,选择Maven->Create ‘settings.xml’(已经存在的话是Open ‘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">
<!-- 填写个人本地仓库路径 -->
<localRepository>E:\zheng\develep\apache-maven-3.8.8\repo</localRepository>
<!-- 镜像配置 -->
<mirrors>
<!-- 阿里云镜像(国内推荐首选) -->
<mirror>
<id>aliyun</id>
<name>Aliyun Maven Mirror</name>
<url>https://maven.aliyun.com/repository/public</url>
<mirrorOf>central</mirrorOf>
</mirror>
<!-- 华为云镜像(备用) -->
<mirror>
<id>huaweicloud</id>
<name>HuaweiCloud Maven Mirror</name>
<url>https://repo.huaweicloud.com/repository/maven/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<!-- Maven中央仓库官方镜像(终极备用) -->
<mirror>
<id>central</id>
<name>Maven Central</name>
<url>https://repo1.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<!-- 性能优化配置 -->
<profiles>
<profile>
<id>optimize</id>
<!-- 启用并行构建 -->
<properties>
<maven.compile.fork>true</maven.compile.fork>
<maven.test.fork>true</maven.test.fork>
</properties>
</profile>
</profiles>
<!-- 激活优化配置 -->
<activeProfiles>
<activeProfile>optimize</activeProfile>
</activeProfiles>
</settings>
第三步:在pom.xml文件上右击,选择Maven->Reimport(或者是Reload project )

注意:
- maven的全局配置默认路径是C:\Users[当前用户].m2\settings.xml,本人默认路径是C:\Users\user\.m2\settings.xml。
- maven的配置路径可以在settings中的maven中修改