maven的设置文件在 conf中的setting.xml,找到mirros标签
在mirros中加入
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
同时把
morros中
<id>maven-default-http-blocker</id>
<mirrorOf>external:http:*</mirrorOf>
<name>Pseudo repository to mirror external repositories initially using HTTP.</name>
<url>http://0.0.0.0/</url>
<blocked>true</blocked>
</mirror>
改为注释,因为上面是外网资源,下载很慢很容易maven文件 不完全导入,容易报错
本文介绍了如何通过修改Maven的配置文件setting.xml,将默认的镜像替换为阿里云的公共仓库,以加快依赖下载速度。同时,注释掉外部HTTP资源的阻止镜像,避免因下载不完整导致的错误。这样做可以显著提高 Maven 构建的效率。
1161

被折叠的 条评论
为什么被折叠?



