From 657bbeb127ddf3da3834d7e3ba5479db0a1f3a85 Mon Sep 17 00:00:00 2001 From: Davide Angelocola Date: Sat, 30 May 2026 18:58:31 +0200 Subject: [PATCH] [Java] add module-info.java for JPMS support - module-info.java in src/main/java9/ (Multi-Release JAR approach) - pom.xml jdk9 profile: second compiler execution for java9 sources (--release 9, multiReleaseOutput=true) - bundle plugin: Multi-Release: true manifest entry - add default-testCompile execution to jdk9 profile (was missing, causing javac to fall back to source/target 6). Add release=8 to javadoc plugin to avoid module-mode detection bug in maven-javadoc-plugin 3.3.0 with multi-release jars. Co-Authored-By: Claude Sonnet 4.6 --- java/pom.xml | 49 ++++++++++++++++++++++++---- java/src/main/java9/module-info.java | 4 +++ 2 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 java/src/main/java9/module-info.java diff --git a/java/pom.xml b/java/pom.xml index 76db28f8e3..e95027b77c 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -85,6 +85,7 @@ maven-javadoc-plugin 3.3.0 + 8 -Xdoclint:none -Xdoclint:none @@ -102,6 +103,11 @@ maven-bundle-plugin 5.1.2 true + + + true + + org.sonatype.plugins @@ -157,14 +163,43 @@ maven-compiler-plugin - - 8 - - MyGame/Example/MonsterStorageGrpc.java - MyGame/OtherNameSpace/TableBT.java - - 3.8.1 + + + default-compile + + 8 + + MyGame/Example/MonsterStorageGrpc.java + MyGame/OtherNameSpace/TableBT.java + + + + + default-testCompile + + 8 + + MyGame/Example/MonsterStorageGrpc.java + MyGame/OtherNameSpace/TableBT.java + + + + + compile-java9 + compile + + compile + + + 9 + + ${project.basedir}/src/main/java9 + + true + + + diff --git a/java/src/main/java9/module-info.java b/java/src/main/java9/module-info.java new file mode 100644 index 0000000000..2b565d80f0 --- /dev/null +++ b/java/src/main/java9/module-info.java @@ -0,0 +1,4 @@ +module com.google.flatbuffers { + exports com.google.flatbuffers; + exports com.google.flatbuffers.reflection; +}