在放maven的安装文件里,找到settings.xml,如下图所示
将默认的源地址改为阿里源,需要在settings.xml文件相应的位置上加上如下的一串:
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>
http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>
http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>
</mirror>
加上后,如下图所示:

加上之后保存文件,之后打开eclipse,找到windows------->preference------->maven------>user settings,点击update setting,update下settings.xml文件,如下图所示:

这样更改的阿里源就可以生效了。