You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Boot 2.7.3 Gradle插件未找到问题求助

Spring Boot Gradle构建插件找不到问题排查

问题说明

从start.spring.io下载的Spring Boot项目构建失败,报错提示找不到版本为2.7.3的org.springframework.boot插件,无法在Gradle中央插件仓库解析对应的插件 artifact。

排查与解决方法

1. 检查网络连接

  • 确认本地网络可正常访问Gradle中央插件仓库,若处于公司内网或受限环境,需配置代理:
    在项目根目录的gradle.properties中添加代理信息:
    systemProp.http.proxyHost=你的代理地址
    systemProp.http.proxyPort=代理端口
    systemProp.https.proxyHost=你的代理地址
    systemProp.https.proxyPort=代理端口
    

2. 核对Gradle版本兼容性

Spring Boot 2.7.3要求Gradle版本至少为7.3,若当前Gradle版本过低会导致插件无法加载:

  • 打开项目gradle/wrapper/gradle-wrapper.properties文件,查看distributionUrl字段:
    distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
    
    若版本低于7.3,替换为符合要求的Gradle版本后重新构建。

3. 补充插件仓库配置

Gradle插件的仓库配置需要单独声明,在settings.gradle中添加以下内容:

pluginManagement {
    repositories {
        gradlePluginPortal()
        mavenCentral()
    }
}
rootProject.name = 'myblog_grd'

4. 刷新依赖缓存

执行命令清理并强制刷新Gradle缓存:

# Linux/Mac
./gradlew clean build --refresh-dependencies

# Windows
gradlew.bat clean build --refresh-dependencies

验证方式

修改配置后执行./gradlew tasks(Windows用gradlew.bat tasks),若能正常显示bootRun等Spring Boot相关任务,说明插件已成功加载。

内容的提问来源于stack exchange,提问作者Myrat Orjyyev

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 10:21:58