开发避坑指南(66):IDEA 2025 Gradle构建安全协议警告:Maven仓库HTTPS切换或允许HTTP的配置方法

报错信息

java 复制代码
A problem occurred configuring root project 'order-service'.
> Could not resolve all dependencies for configuration 'classpath'.
   > Using insecure protocols with repositories, without explicit opt-in, is unsupported.

* Try:
> Switch Maven repository 'maven(xxx)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols.

错误分析

Gradle 7.0 版本构建项目以上就会出现这个问题,Gradle从高版本开始默认禁止使用不安全的HTTP协议访问Maven仓库所致。

解决办法

1、将仓库访问地址由http修改为https。

2、修改build.gradle配置,显式允许不安全协议。

groovy 复制代码
repositories {
    maven {
        allowInsecureProtocol = true
        url "maven仓库地址"
    }
}
相关推荐
浪客川10 小时前
使用 IDEA 生成API文档
java·ide·intellij-idea
sugar__salt3 天前
Spring、Spring Boot 与配置文件核心知识点详解
java·spring boot·后端·spring·java-ee·maven·intellij-idea
Slow菜鸟3 天前
第3篇:实操落地篇 · 3套企业标准工作流(IDEA可视化版)
java·ide·intellij-idea
不谈恋爱的猫3 天前
idea集成git
java·git·intellij-idea
sugar__salt5 天前
Spring 三层架构与 IoC、依赖注入完全指南
java·spring boot·后端·spring·架构·maven·intellij-idea
mh_f6 天前
34.JRebel启动报错问题
intellij-idea
程序员钟霖6 天前
【实战版】Spring IOC 控制反转详解
java·后端·spring·maven·intellij-idea
骇客野人7 天前
IntelliJ IDEA 菜单中英对照
java·ide·intellij-idea
骇客野人7 天前
IDEA 安装 Trae(TRAE AI: Coding Assistant)完整步骤
java·ide·intellij-idea
骇客野人7 天前
IntelliJ IDEA 使用技巧
java·ide·intellij-idea