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

求助:为Google App Engine更新Gradle版本以解决Spring Boot插件兼容问题

Fixing Gradle Version Mismatch on Google Cloud App Engine for Spring Boot Apps

Got it, let's work through this Gradle version error you're hitting. The Spring Boot plugin requires Gradle 4.0 or later message tells us App Engine is still picking up the old Gradle 2.12 version, even after you updated the wrapper files. Here are actionable steps to fix this:

  • Double-check your gradle-wrapper.properties file
    It looks like your property content got truncated, so make sure the distributionUrl line is fully specified and correct. It should look like this:

    #Tue Apr 17 09:15:25 SGT 2018
    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-bin.zip
    

    A missing or incomplete URL will cause the wrapper to fall back to the old version.

  • Confirm the gradle-wrapper.jar is in the correct location
    This jar file needs to live in your project's gradle/wrapper/ directory. When deploying to App Engine, ensure this entire directory is included in your upload—if the jar is missing or in the wrong place, App Engine can't use your custom wrapper.

  • Force App Engine to use the Gradle wrapper
    Make sure your deployment is using the project-local gradlew script instead of a system-wide Gradle installation. If you're using gcloud app deploy, it should automatically detect the wrapper, but you can explicitly reference it in your build steps if needed. For example, run ./gradlew appengineDeploy locally instead of relying on App Engine's default build process.

  • Clean local and remote caches

    1. First, run ./gradlew clean build locally to verify your project builds with Gradle 4.5.1. This ensures your local setup is working before deploying.
    2. When deploying to App Engine, add the --no-cache flag to bypass any cached build assets:
      gcloud app deploy --no-cache
      

    This forces App Engine to re-download the specified Gradle version instead of using a cached old one.

  • Check Spring Boot plugin compatibility
    While your error is directly about Gradle version, ensure your Spring Boot plugin version in build.gradle is compatible with Gradle 4.5.1. Most Spring Boot 2.x versions work fine with Gradle 4.x, but double-checking avoids hidden conflicts.

内容的提问来源于stack exchange,提问作者Developer Admiral Digital

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.26 10:13:25