Maven加载依赖:默认先从项目maven配置的本地仓库查找,
如果找到直接使用,
如果没有,默认情况下去国外maven中央 仓库下载(从国外下载距离远,非常慢,可能出现下载错误),先下载到本地,在使用。
使用国内阿里云镜像仓库的话会非常快,这时maven先从国内仓库找,如果有就下载到本地仓库在使用,没有只能从国外maven中央 仓库下载到本地仓库在使用。
配置如下:
在apache-maven-3.6.3\conf找到setting.xml文件在mirrors标签下添加
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
如果想改地址的话在setting.xml文件下添加localRepository标签
<localRepository>E:/springboot/maven/myrepository</localRepository>