当前位置:   article > 正文

Since Maven 3.8.1 http repositories are blocked.

Since Maven 3.8.1 http repositories are blocked.

编译maven 项目时候报错提示下面信息:

  1. Since Maven 3.8.1 http repositories are blocked.
  2. Possible solutions:
  3. - Check that Maven settings.xml does not contain http repositories
  4. - Check that Maven pom files do not contain http repository http://XXXXXX:8081/repository/maven-public/
  5. - Add a mirror(s) for http://XXXXXX:8081/repository/maven-public/ that allows http url in the Maven settings.xml
  6. - 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

  1. <mirror>
  2. <id>maven-default-http-blocker</id>
  3. <mirrorOf>dummy</mirrorOf>
  4. <name>Dummy mirror to override default blocking mirror that blocks http</name>
  5. <url>http://0.0.0.0/</url>
  6. <blocked>false</blocked>
  7. </mirror>




声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/450424
推荐阅读
相关标签
  

闽ICP备14008679号