protocolbuffers / protocolbuffers/protobuf
Add a `module-info.java`
@esrauchg is already working on this.
Since Jun 3, 2025.
- Dominant language
- C++
- Stars
- 72k
- Forks
- 16.3k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 140
Description
What language does this apply to?
If it's a proto syntax change, is it for proto2 or proto3? N/A
If it's about generated code change, what programming language? Java
Describe the problem you are trying to solve.
I want to use Protobuf Java with jlink. Unfortunately, jlink rejects JARs with an Automatic-Module-Name set; it is required to define a module-info.java.
Describe the solution you'd like
I would like Protobuf Java to ship a module-info.java, in an MRJAR, to preserve existing JDK support. I am not proposing a change to the JVM bytecode minimum support level.
Describe alternatives you've considered
I have considered solutions like Moditect, but they complicate my build greatly because dependencies must be transformed before being consumed by the Java Compiler.
Additional context
Guava is considering a PR for this. Recently, Error Prone and other core libs have released new versions with a module-info.java definition. Thus, Protobuf's transitive dependencies may be ready for a fully modular Java build.
UPDATE: Guava has shipped JPMS.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.