编译maven 项目时候报错提示下面信息:
Since Maven 3.8.1 http repositories are blocked.
Possible solutions:
- Check that Maven settings.xml does not contain http repositories
- Check that Maven pom files do not contain http repository http://XXXXXX:8081/repository/maven-public/
- Add a mirror(s) for http://XXXXXX:8081/repository/maven-public/ that allows http url in the Maven settings.xml
- Downgrade Maven to version 3.8.1 or earlier in settings
使用私服作为mirrors,如果你的maven是3.8.1+的版本,我用的是3.9.6版本.
会提示:Since Maven 3.8.1 http repositories are blocked。
自从3.8.1版本开始,处于安全考虑,maven禁用了http的镜像仓库,企业安装的私服通常都是http的地址,所以报这个错误。
修改方案
在pom.xml
<mirror>
<id>maven-default-http-blocker</id>
<mirrorOf>dummy</mirrorOf>
<name>Dummy mirror to override default blocking mirror that blocks http</name>
<url>http://0.0.0.0/</url>
<blocked>false</blocked>
</mirror>