由于使用maven下载依赖的时候需要去国外的仓库下载,下载特别慢。
所以我们可以设置阿里云镜像,直接从阿里云的仓库下载依赖,下载就特别快了
1.创建Maven的配置文件
创建settings.xml或者修改你已有的settings.xml
内容如下
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
</settings>