可以添加阿里云的镜像到maven的setting.xml配置中,这样就不需要每次在pom中,添加镜像仓库的配置,在mirrors节点下面添加子节点:
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
< mirrorOf>可以设置为哪个中央仓库做镜像,为名为“central”的中央仓库做镜像,写作< mirrorOf>central< /mirrorOf>;为所有中央仓库做镜像,写作< mirrorOf>*< /mirrorOf>。Maven默认中央仓库的id 为 central。id是唯一的。