1.Maven项目中,在pom.xml的标签之前加入一下标签,指定使用阿里云仓库下载jar包。
<!-- 使用aliyun maven -->
<repositories>
<repository>
<id>aliyun</id>
<name>aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</repository>
</repositories>
使用此方式指定下载源之后,不会根据Maven本地配置下载依赖。
或者
2.国内连接maven官方的仓库更新依赖库,网速一般很慢,收集一些国内快速的maven仓库镜像以备用。
最全的镜像
http://mvnrepository.com/ 这里面可以查到的都有
<mirror>
<id>maven</id>
<name>central maven</name>
<url>http://central.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
最快的镜像是
maven阿里云中央仓库
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
————————————————
版权声明:本文为优快云博主「eplusing」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.youkuaiyun.com/cpp1781089410/article/details/87897422