maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories

前言

说明

新设备上安装了mvn 3.8.5,编译新项目出错:

[ERROR]     Non-resolvable parent POM for com.admin.project:1.0: Could not transfer artifact com.extend.parent:pom:1.6.9 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [aliyun-release (http://maven.aliyun.com/nexus/content/groups/public/, default, releases+snapshots), self-release (http://82.xxx.xxx.xxx:8081/repository/maven-releases/, default, releases+snapshots)] and 'parent.relativePath' points at no local POM @ line 5, column 10 -> [Help 2]

分析

maven在3.8.1 的默认配置文件中增加了一组标签,如果仓库镜像是http 而不是https 就会被拦截禁止访问。
这个项目中使用了公司的私服,不支持https,所以无法连接私服下载jar。
maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories_第1张图片

解决办法1:注释掉 $MAVEN_HOME/conf/settings.xml 中的拦截标签

maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories_第2张图片

其它解决办法

参考这里:Maven升级3.8.1后maven-default-http-blocker (http0.0.0.0) Blocked mirror for repositories

参考

https://maven.apache.org/docs/3.8.1/release-notes.html
Maven升级3.8.1后maven-default-http-blocker (http0.0.0.0) Blocked mirror for repositories

你可能感兴趣的:(maven,maven,java)