Maven 提供了全局配置文件 settings.xml 针对所有项目有效,位置是在maven安装目录下的 conf 目录里。
在 settings.xml 下找到 <mirrors> 节点,并在节点下增加阿里云仓库镜像配置
<mirror> <id>nexus-aliyun</id> <mirrorOf>central</mirrorOf> <name>Nexus aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> </mirror>