Add module-info.java to flatbuffers-java for JPMS support
- Dominant language
- C++
- Stars
- 26.5k
- Forks
- 3.7k
- PR merge metrics
- No merged PRs in 30d
Description
## 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:
1. 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.
2. 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`:
```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
Contributor guide
Assessment
This issue has not been assessed yet.