From 1acb6fea52f78d4c4c4613c868a5b88a6b6a3784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Mon, 14 Dec 2020 14:11:00 +0100 Subject: [PATCH] HHH-14371 Add --add-opens options required for Gradle plugin tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yoann Rodière --- .../hibernate-gradle-plugin/hibernate-gradle-plugin.gradle | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tooling/hibernate-gradle-plugin/hibernate-gradle-plugin.gradle b/tooling/hibernate-gradle-plugin/hibernate-gradle-plugin.gradle index 9ce68edeef..2d10c66dc5 100644 --- a/tooling/hibernate-gradle-plugin/hibernate-gradle-plugin.gradle +++ b/tooling/hibernate-gradle-plugin/hibernate-gradle-plugin.gradle @@ -36,3 +36,10 @@ else { logger.warn( "[WARN] Toolchains are not yet supported for Groovy compilation." + " Using the JDK that runs Gradle for Groovy compilation." ) } + +tasks.test { + if ( gradle.ext.javaVersions.test.launcher.asInt() >= 9 ) { + // Needs add-opens because Gradle uses illegal accesses to inject... mocks? Something like that. + jvmArgs( ['--add-opens', 'java.base/java.lang=ALL-UNNAMED'] ) + } +}