From f1c08e8e977bc57ce951ba722a766571cfe68773 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Tue, 30 Aug 2022 12:58:07 +0200 Subject: [PATCH] Fix wrong toolchain configuration for java17 tests --- hibernate-core/hibernate-core.gradle | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hibernate-core/hibernate-core.gradle b/hibernate-core/hibernate-core.gradle index 89c756fb4f..b68953b6fe 100644 --- a/hibernate-core/hibernate-core.gradle +++ b/hibernate-core/hibernate-core.gradle @@ -230,6 +230,9 @@ if ( gradle.ext.javaVersions.test.release.asInt() >= 17 ) { // For the new source set, we need to configure the source and target version to 17 compileTestJava17Java { + javaCompiler = javaToolchains.compilerFor { + languageVersion = gradle.ext.javaVersions.test.compiler + } sourceCompatibility = 17 targetCompatibility = 17 // We also depend on the main test resources @@ -250,6 +253,9 @@ if ( gradle.ext.javaVersions.test.release.asInt() >= 17 ) { // We execute the Java 17 tests in a custom test task task java17Test(type: Test) { + javaLauncher = javaToolchains.launcherFor { + languageVersion = gradle.ext.javaVersions.test.launcher + } useJUnitPlatform() testClassesDirs = sourceSets.testJava17.output.classesDirs classpath = sourceSets.testJava17.runtimeClasspath