diff --git a/build.gradle b/build.gradle index a7c8b0835..493c2e11d 100644 --- a/build.gradle +++ b/build.gradle @@ -90,7 +90,9 @@ allprojects { "--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED", "--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED", "--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", - "--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED" + "--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", + "--add-opens=java.base/java.lang=ALL-UNNAMED", + "--add-opens=java.base/java.util=ALL-UNNAMED" ] //https://stackoverflow.com/questions/3963708/gradle-how-to-display-test-results-in-the-console-in-real-time testLogging { diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 6c10ead1d..0e1e9fe80 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -7,6 +7,13 @@ repositories { mavenCentral() } +if ((JavaVersion.current().getMajorVersion() as int) >= 17) { + tasks.withType(Test).configureEach { + jvmArgs(["--add-opens=java.base/java.lang=ALL-UNNAMED", + "--add-opens=java.base/java.util=ALL-UNNAMED"]) + } +} + dependencies { testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.2") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.2")