Gradle cannot resolve spring-boot-gradle-plugin after a Spring Boot 3 upgrade
Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.1Short 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.
Fix it fast
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 -version2Match what you see, then jump to its fix
- 1
The first lines of ./gradlew --version show a JVM of 8 or 11Gradle runs on a JDK older than 17Fix - 2
gradle-wrapper.properties names a Gradle 6 or an early 7 releaseThe Gradle wrapper is older than Spring Boot supportsFix - 3
The searched sources do not include plugins.gradle.orgpluginManagement does not list the Gradle Plugin PortalFix
- 1
What does the error look like?
Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.1Plugin [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 jvm2Fix
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 --version3Verify
The JVM line shows 17 or higher.
./gradlew --version | grep -i jvmConfirmed by docs.spring.io
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.properties2Fix
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 wrapper3Verify
The distributionUrl shows the new version and the plugin resolves.
grep distributionUrl gradle/wrapper/gradle-wrapper.properties
./gradlew helpConfirmed by docs.gradle.org
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/null2Fix
Add gradlePluginPortal() to pluginManagement in settings.gradle.
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
}
}3Verify
The plugin resolves on the next sync.
./gradlew helpConfirmed by docs.gradle.org
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:
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
- Nuclear Home VideoA video-streaming Android app built from scratch, engineered for smooth playback.
Related fixes
Mobile apps
Gradle says the plugin id you asked for does not exist in any repository it searched
Gradle Central Plugin Repository (no 'google()' listed)
Gradle searched every repository listed for plugins and none had that id at that version.
3 causes, each with a fixBack end
A scanner flags jackson-databind: how to upgrade it in Gradle
jackson-databind vulnerability reported by a dependency scanner
Find where the old jackson-databind comes from, then raise it.
3 causes, each with a fixBack end
bootJar cannot find the main class of a Spring Boot project
Main class name has not been configured and it could not be resolved
The Spring Boot Gradle plugin looks in the main source set's output for a class with a public static void main method.
2 causes, each with a fixBack end
Spring Boot fails at startup with an error processing a condition on an auto-configuration
java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.jdbc.JndiDataSourceAutoConfiguration
This message only says Spring Boot failed while evaluating an auto-configuration condition.
3 causes, each with a fixBack end
Swagger UI URL shows the Whitelabel Error Page in Spring Boot
Whitelabel Error Page when opening /swagger-ui.html
The Whitelabel page means Spring found no handler for that address.
3 causes, each with a fixBack 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