开发避坑指南(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仓库地址"
    }
}
相关推荐
范什么特西19 小时前
下载idea旧版本
java·ide·intellij-idea
内存不泄露19 小时前
基于Spring Boot和Vue的企业办公自动化系统设计与实现
java·vue.js·spring boot·intellij-idea
五阿哥永琪21 小时前
Spring boot 在IDEA中如何让一个应用在不同的端口多次启动?
spring boot·后端·intellij-idea
计算机毕设指导61 天前
基于微信小程序的精致护肤购物系统【源码文末联系】
java·spring boot·微信小程序·小程序·tomcat·maven·intellij-idea
ybb_ymm1 天前
尝试新版idea及免费学习使用
java·学习·intellij-idea
luming-022 天前
报错解决:IDEA终端输出和CMD终端输出Maven版本不一致
java·缓存·bug·intellij-idea
zhanglb122 天前
Gradle 全局配置使用
gradle·android studio·intellij idea
Chan162 天前
微服务 - Higress网关
java·spring boot·微服务·云原生·面试·架构·intellij-idea
shughui2 天前
最新版IntelliJ IDEA下载+安装+汉化(详细图文)
java·ide·intellij-idea
怦怦蓝2 天前
IDEA 开发邮件发送功能:全流程报错解决方案汇总
java·ide·intellij-idea·发邮件