修改配置文件 ~/.m2/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>aliyun-central</id>
<mirrorOf>central</mirrorOf>
<name>阿里云 maven 仓库镜像</name>
<url>https://maven.aliyun.com/repository/public/</url>
</mirror>
<mirror>
<id>huaweicloud</id>
<mirrorOf>central</mirrorOf>
<name>华为 maven 仓库镜像</name>
<url>https://repo.huaweicloud.com/repository/maven/</url>
</mirror>
</mirrors>
</settings>
阿里云 maven 仓库镜像介绍:https://developer.aliyun.com/mvn/guide
华为开源镜像站:https://mirrors.huaweicloud.com/home