maven阻止HTTP协议的仓库访问

发现报错

failed to transfer from http://0.0.0.0/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of maven-default-http-blocker has elapsed or updates are forced. Original error: Could not transfer artifact com.... from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: maven.repository (http://.../, default, releases+snapshots)

原因

Maven 3.8.1+ 默认阻止 HTTP 仓库

从 Maven 3.8.1 开始,默认禁用了不安全的 HTTP 仓库

解决

复制代码
<settings>
  <!-- 允许 HTTP 的非加密连接 -->
  <mirrors>
    <!-- 移除或注释掉 maven-default-http-blocker -->
  </mirrors>
  
  <profiles>
    <profile>
      <id>allow-http</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>your-repo</id>
          <url>http://.......</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>
相关推荐
chuan.bai1 小时前
Java RAG 实战(第 11 篇):RAG 知识工作台网页
java·开发语言·人工智能
0x533 小时前
网站通信(一)
java
Terra.K4 小时前
Java异常学习[特殊字符]
java·开发语言·学习
葡萄城技术团队5 小时前
InfluxDB 2\.x 深度解析:核心架构、Flux 函数与制造业落地指南(三)
java·开发语言·架构
Super 含5 小时前
Android 启动优化(五):线程、GC 与 IO 为什么会拖慢启动?
java·服务器·数据库
counting money5 小时前
Java IO流详解:从InputStream到文件操作实战
java·开发语言·python
程序员小八7776 小时前
上海百度B端java后端日常实习一面
java·开发语言
mldong7 小时前
零依赖的秘密:8 大 SPI 设计
java·架构
Diligently_9 小时前
Anolis 系统更新与密码设置&磁盘扩容
java·后端·spring