From 3982070c0d8b934664aed79e078f99853e0c681f Mon Sep 17 00:00:00 2001 From: Jayesh45-master Date: Sun, 28 Dec 2025 15:44:06 +0530 Subject: [PATCH] maven fix2 Fix JDK 21 test failures by propagating --add-opens to forked JVM Ensure Surefire passes required --add-opens options alongside the JaCoCo agent using the supported @{jacocoArgLine} mechanism. This fixes InaccessibleObjectException failures on JDK 21+ while preserving existing test and coverage behavior. Fixes #11398 --- pom.xml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/pom.xml b/pom.xml index 8dbe081e36f1..8664f35773e5 100644 --- a/pom.xml +++ b/pom.xml @@ -512,6 +512,34 @@ under the License. org.codehaus.plexus plexus-component-metadata ${plexusVersion} + + + org.apache.maven.plugins + maven-surefire-plugin + + + -Xmx256m @{jacocoArgLine} --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED + + ${toolboxVersion} + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + -Xmx256m @{jacocoArgLine} + + ${toolboxVersion} + + + + + + com.github.siom79.japicmp + japicmp-maven-plugin + 0.25.1