我们使用maven的时候,会发现下载文件困难,这是由于maven的服务器在国外,因此需要加入阿里云镜像。加入阿里云镜像的步骤如下:找到maven的配置文件:例如:D:\ITSoftware\maven\apache-maven-3.2.2\conf\settings.xml找到该配置文件settings.xml文件中mirrors标签在该标签体内加入如下代码:
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>uk</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://uk.maven.org/maven2/</url>
</mirror>
<mirror>
<id>CN</id>
<name>OSChina Central</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>nexus</id>
<name>internal nexus repository</name>
<!-- <url>http://192.168.1.100:8081/nexus/content/groups/public/</url>-->
<url>http://repo.maven.apache.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
支持!
关注一下呗!