From b9f2a2a4cfa517ece6798af52fbc1b1df5c996c0 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Mon, 8 Jul 2024 14:55:49 -0600 Subject: [PATCH] Add jvmArgs needed by Chronicle with jdk 17 strong encapsulation --- gradle/any/properties.gradle | 14 ++++++++++++++ tdcommon/build.gradle | 4 ++++ tds/build.gradle | 6 +++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/gradle/any/properties.gradle b/gradle/any/properties.gradle index a132de0eea..d3d56b1558 100644 --- a/gradle/any/properties.gradle +++ b/gradle/any/properties.gradle @@ -52,3 +52,17 @@ ext { getPropertyOrFailBuild = this.&getPropertyOrFailBuild addFilteredSysProps = this.&addFilteredSysProps } + +ext { + jvmArguments = [ + '--add-exports', 'java.base/jdk.internal.ref=ALL-UNNAMED', + '--add-exports', 'java.base/sun.nio.ch=ALL-UNNAMED', + '--add-exports', 'jdk.unsupported/sun.misc=ALL-UNNAMED', + '--add-exports', 'jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED', + '--add-opens', 'jdk.compiler/com.sun.tools.javac=ALL-UNNAMED', + '--add-opens', 'java.base/java.lang=ALL-UNNAMED', + '--add-opens', 'java.base/java.lang.reflect=ALL-UNNAMED', + '--add-opens', 'java.base/java.io=ALL-UNNAMED', + '--add-opens', 'java.base/java.util=ALL-UNNAMED', + ] +} diff --git a/tdcommon/build.gradle b/tdcommon/build.gradle index d73d713a8c..c8ea803b74 100644 --- a/tdcommon/build.gradle +++ b/tdcommon/build.gradle @@ -48,3 +48,7 @@ spotless { tasks.named('sourceJar').configure { dependsOn('generateProto') } + +test { + jvmArgs = jvmArguments +} diff --git a/tds/build.gradle b/tds/build.gradle index 1675fc922d..68c111ccc9 100644 --- a/tds/build.gradle +++ b/tds/build.gradle @@ -254,10 +254,14 @@ import org.akhikhl.gretty.AppAfterIntegrationTestTask import java.nio.file.Paths +test { + jvmArgs = jvmArguments +} + gretty { httpPort = 8081 contextPath = '/thredds' - jvmArgs = ['--add-exports', 'java.base/jdk.internal.ref=ALL-UNNAMED'] + jvmArgs = jvmArguments } def testInfomation = [[name: 'freshInstallTest',