Skip to content

Commit

Permalink
Fix wrong toolchain configuration for java17 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
beikov committed Aug 30, 2022
1 parent d2cca54 commit f1c08e8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hibernate-core/hibernate-core.gradle
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f1c08e8

Please sign in to comment.