项目内:
pom.xml
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
maven工具配置:
<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>
如图,项目运行下载依赖,又去repo.spring.io/oss.jfrog.org/jcenter.bintray.com去下载jar,慢的很。
使用命令行来解决,步骤如下:
mvn -X
Reading global settings from
以及Reading user settings from
两项。repo.spring.io/oss.jfrog.org/jcenter.bintray.com
,如果阿里云配置的正确,在执行mvn install
时还是由上面的地址下载包,那么说明http://maven.aliyun.com/nexus/content/groups/public
这个仓库中并不存在那个特定的包,所以即使是阿里云配置正确了,也同样没有办法由阿里云获取。