diff --git a/gradle.properties b/gradle.properties index 8dfa7ab652..134b7bf890 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,7 +18,7 @@ org.gradle.caching=true # but it won't find it and will fail. # It's just a JRE, so it's perfectly normal that the JDK is not present; # the JRE is under /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.265.b01-1.fc32.x86_64/jre -org.gradle.java.installations.auto-detect=true +org.gradle.java.installations.auto-detect=false # We can't rely on Gradle's auto-download of JDKs as it doesn't support EA releases. # See https://github.com/gradle/gradle/blob/fc7ea24f3c525d8d12a4346eb0f15976a6be9414/subprojects/platform-jvm/src/main/java/org/gradle/jvm/toolchain/install/internal/AdoptOpenJdkRemoteBinary.java#L114 org.gradle.java.installations.auto-download=false diff --git a/hibernate-jfr/hibernate-jfr.gradle b/hibernate-jfr/hibernate-jfr.gradle index 6be221aa7d..de52eac5af 100644 --- a/hibernate-jfr/hibernate-jfr.gradle +++ b/hibernate-jfr/hibernate-jfr.gradle @@ -16,16 +16,12 @@ dependencies { testImplementation testLibs.jfrUnit } -compileTestJava { - //Testing JFR events require JDK > 16 - javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of( 17 ) - } + +// JfrUnit requires JDK 17 +compileTestJava.onlyIf{ + jdkVersions.test.release.asInt() >= 17 && jdkVersions.explicit } -test { - //Testing JFR events require JDK > 16 - javaLauncher = javaToolchains.launcherFor { - languageVersion = JavaLanguageVersion.of( 17 ) - } -} +test.onlyIf { + jdkVersions.test.release.asInt() >= 17 && jdkVersions.explicit +} \ No newline at end of file