Maven仓库配置阿里云镜像
在下载maven依赖时,速度过慢,因为使用的默认是国外的仓库,可修改配置文件,更换为国内镜像,加快下载速度
修改文件:
Maven安装目录 / conf / 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://repo.maven.apache.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
保存修改,重新下载依赖即可!
ps:使用例如 IDEA 编辑器时记得设置为已修改的Maven配置文件~