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>
相关推荐
huangdong_21 小时前
电商平台图片URL原图转换技术深度解析:从缩略图到高清原图的完整方案
java·后端·spring
記億揺晃着的那天21 小时前
Java 调用外部 Go 程序的实践:ProcessBuilder 在生产环境中的应用
java·golang·processbuilder
JAVA面经实录91721 小时前
Java 数据结构与算法 (终极完整学习文档)
java·数据结构·算法
JAVA面经实录9171 天前
操作系统面试题
java·服务器·数据库·计算机网络·面试
一杯奶茶¥1 天前
基于springboot的失物招领管理系统带万字文档 校园失物招领管理系统 失物认领管理系统java springboot vue
java·vue.js·spring boot·java项目
不能只会打代码1 天前
边缘视频分析平台的架构设计与性能优化——从750ms到190ms的调优之路
java·spring boot·redis·性能优化·边缘计算·物联网竞赛
小刘|1 天前
Spring AI Alibaba 集成和风天气 API 实战
java·服务器·前端
KANGBboy1 天前
java知识五(继承)
java·开发语言
AI人工智能+电脑小能手1 天前
【大白话说Java面试题 第117题】【并发篇】第17题:线程有几种状态,之间如何转换?
java·开发语言·面试
DIY源码阁1 天前
JavaSwing饮品管理系统 - MySQL版
java·数据库·mysql·eclipse