Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Node.js, PHP and APIs

Gradle cannot resolve spring-boot-gradle-plugin after a Spring Boot 3 upgrade

ErrorCould not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.1

Short answer

Spring Boot 3 needs Java 17 or newer and a recent Gradle, and its Gradle plugin is published on the Gradle Plugin Portal. The build fails to resolve the plugin when Gradle runs on an older JDK, when the wrapper is too old, or when pluginManagement does not list the portal. Check java -version and gradlew --version first.

  • Applies to Spring Boot 3.5, Gradle 8.x, Java 17 and 21
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Print which JVM and Gradle version the wrapper actually uses. Both must meet the Spring Boot requirements.

    ./gradlew --version
    java -version
  2. 2Match what you see, then jump to its fix

    1. 1The first lines of ./gradlew --version show a JVM of 8 or 11Gradle runs on a JDK older than 17Fix
    2. 2gradle-wrapper.properties names a Gradle 6 or an early 7 releaseThe Gradle wrapper is older than Spring Boot supportsFix
    3. 3The searched sources do not include plugins.gradle.orgpluginManagement does not list the Gradle Plugin PortalFix

What does the error look like?

  • Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.1
  • Plugin [id: 'org.springframework.boot', version: '3.0.1'] was not found in any of the following sources

Cause 1 of 3

Gradle runs on a JDK older than 17

1Check

Spring Boot 3.5 requires at least Java 17. A Gradle process on Java 8 or 11 is below that requirement, so start by moving it.

./gradlew --version | grep -i jvm

2Fix

Install a JDK 17 or newer and point Gradle at it, with JAVA_HOME or the Gradle JDK setting in your IDE.

export JAVA_HOME=/path/to/jdk-17
./gradlew --version

3Verify

The JVM line shows 17 or higher.

./gradlew --version | grep -i jvm

Confirmed by docs.spring.io

Did this fix it?

Cause 2 of 3

The Gradle wrapper is older than Spring Boot supports

1Check

Spring Boot 3.5 lists Gradle 7.6.4 or later in the 7.x line, or 8.4 or later. An older wrapper is outside that range.

grep distributionUrl gradle/wrapper/gradle-wrapper.properties

2Fix

Update the wrapper to a supported release. Run the task twice so the scripts and jar update as well.

./gradlew wrapper --gradle-version 8.14
./gradlew wrapper

3Verify

The distributionUrl shows the new version and the plugin resolves.

grep distributionUrl gradle/wrapper/gradle-wrapper.properties
./gradlew help

Confirmed by docs.gradle.org

Did this fix it?

Cause 3 of 3

pluginManagement does not list the Gradle Plugin Portal

1Check

Spring Boot's plugin is published on the Plugin Portal. Declaring repositories in pluginManagement replaces the default, so the portal is searched only when gradlePluginPortal() is listed.

sed -n '1,20p' settings.gradle settings.gradle.kts 2>/dev/null

2Fix

Add gradlePluginPortal() to pluginManagement in settings.gradle.

pluginManagement {
    repositories {
        gradlePluginPortal()
        mavenCentral()
    }
}

3Verify

The plugin resolves on the next sync.

./gradlew help

Confirmed by docs.gradle.org

Did this fix it?

How do I stop it coming back?

  • Set the Java toolchain in build.gradle so the JDK version is declared in the project, not on one machine.
  • Upgrade the Gradle wrapper before you bump the Spring Boot version.
  • Read the system requirements page of the Spring Boot version you target before upgrading.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Back end

Spring Boot will not start because port 8080 is already taken

Action: Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.

Spring Boot listens on 8080 unless told otherwise, and only one process can own a port.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.