HHH-14371 Add --add-opens options required for Gradle plugin tests

Signed-off-by: Yoann Rodière <yoann@hibernate.org>
This commit is contained in:
Yoann Rodière 2020-12-14 14:11:00 +01:00 committed by Sanne Grinovero
parent 6396cd17a2
commit 1acb6fea52
1 changed files with 7 additions and 0 deletions

View File

@ -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'] )
}
}