Problem
flatbuffers-java ships without a module-info.java, so it becomes a filename-based
automatic module on the Java module path. This has two consequences:
- The module name (
flatbuffers.java) is derived from the JAR filename and can change if the
artifact is renamed or shaded — making it unreliable to requires in downstream
module-info.java files.
- Maven Surefire (and other tools) warn that projects depending on filename-based automodules
must not be published to Maven Central as proper modular JARs:
[WARNING] Required filename-based automodules detected: [flatbuffers-java-25.2.10.jar].
Please don't publish this project to a public artifact repository!
Expected
flatbuffers-java ships with a module-info.java that:
- declares a stable module name (e.g.
com.google.flatbuffers)
- exports
com.google.flatbuffers
Suggested change
Add java/src/main/java/module-info.java:
module com.google.flatbuffers {
exports com.google.flatbuffers;
}
This is a non-breaking addition. Classpath users are unaffected; module-path users get a
stable, named module.
Environment
- flatbuffers-java 25.2.10
- Java 25 / JPMS
Problem
flatbuffers-javaships without amodule-info.java, so it becomes a filename-basedautomatic module on the Java module path. This has two consequences:
flatbuffers.java) is derived from the JAR filename and can change if theartifact is renamed or shaded — making it unreliable to
requiresin downstreammodule-info.javafiles.must not be published to Maven Central as proper modular JARs:
Expected
flatbuffers-javaships with amodule-info.javathat:com.google.flatbuffers)com.google.flatbuffersSuggested change
Add
java/src/main/java/module-info.java:This is a non-breaking addition. Classpath users are unaffected; module-path users get a
stable, named module.
Environment