Browse Source

Fail fast with explicit error message for incompatible JDK version

See gh-46818

Signed-off-by: BenchmarkingBuffalo <46448799+BenchmarkingBuffalo@users.noreply.github.com>
pull/48153/head
BenchmarkingBuffalo 4 months ago committed by Moritz Halbritter
parent
commit
2998e84616
  1. 5
      settings.gradle

5
settings.gradle

@ -47,6 +47,11 @@ rootProject.name="spring-boot-build" @@ -47,6 +47,11 @@ rootProject.name="spring-boot-build"
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
settings.gradle.projectsLoaded {
ensureCompatibleJavaVersion -> {
if (!JavaVersion.current().isCompatibleWith(JavaVersion.toVersion(24))) {
throw new GradleException("Java 24 or newer is needed to compile. Java version used is ${JavaVersion.current().toString()}.")
}
}
develocity {
buildScan {
def toolchainVersion = settings.gradle.rootProject.findProperty('toolchainVersion')

Loading…
Cancel
Save