1)setting.xml中配置好maven镜像
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>2)修改工程中使用的setting.xml文件的位置

-----------------
或者在pom.xml中增加配置
<repositories>
<repository>
<id>nexus-aliyun</id>
<name>nexus-aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>版权声明:本文为themagickeyjianan原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。