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>
相关推荐
闲猫3 小时前
Spring AI 对接Deepseek ChatModel 聊天对话
java·前端·spring
自信的未来5 小时前
JSON 工具|Web Worker 工程化打包 + 语法自动修复 + 多语言代码生成实战
java·前端·json
Brookty5 小时前
【JavaEE】线程安全(一).4:写块串行保安全、CAS
java·开发语言·java-ee·多线程·线程安全
怕孤单的草丛6 小时前
缓存管理面临的主要问题
java·数据库·缓存
犀利豆8 小时前
AI in Harness(二)
java·人工智能·后端
沉静的小伙10 小时前
在微服务中使用领域事件
java·运维·微服务
程序员在囧途10 小时前
likeadmin-api API 算力超市怎么做供应商切换?统一鉴权、task_id 和 callback_url 才能稳交付
java·服务器·数据库·开放api·likeadmin-api·api算力超市
醇氧10 小时前
Spring 容器 Map 注入机制详解
java·后端·spring
ylscode10 小时前
Cloudflare Workers Cache 深度解析:边缘缓存如何重塑无服务器性能边界
java·spring·mybatis