[Bug]: Only one module's pb file is generated
Brief description
I have several modules, but I have to put all the protobuf files in one module, if I put them in several modules, then compilng error.
Steps to reproduce
- make a project with 3 modules
- put two protobufs in two differnet modules.
- reference them in another module
- compiling
Error message
Logs
Operating system
macos Darwin Mac.local 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:33:36 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6030 arm64
JDK version
java 21
Maven version
3.9.9
Plugin version
4.0.3
Protoc version
4.33.1
Additional details
I have to put them in the same module
Would you like to contribute a bugfix?
- [ ] Yes, I'd like to contribute a bugfix!
I've redacted any private information from my responses
- [x] Yes, there is no sensitive information here.
Can you show your POM? If you've referenced them as a dependency then they should be pulled through.
You mention a compiling error, is this javac or protoc that is failing?
Would be worth cross referencing with the docs at https://ascopes.github.io/protobuf-maven-plugin/dependencies.html#a-simple-example and the integration tests at https://github.com/ascopes/protobuf-maven-plugin/tree/main/protobuf-maven-plugin/src/it if possible to see if there are any differences with what you have locally 🙂
Java error, the file is not generated.
in both module I have
<build>
<plugins>
<plugin>
<groupId>io.github.ascopes</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
and in parent module's pluginManagement:
<plugin>
<groupId>io.github.ascopes</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>4.0.3</version>
<configuration>
<protoc>${protobuf.version}</protoc>
</configuration>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
quite common .
How are you depending on the other module?
If I put the internal-protocols.proto in the folder of tmcp-persistence module, then it fails, only the shared-protocol.proto is generated.
Think I'm going to need to see a project to get an idea of what is happening. Please could you make a minimal working reproduction that you could upload?
Yes, but I'm currently very busy implementing the MCP Task at work, so I think I can submit a reproducer next weekend. And thank you very much for keeping this project alive.
And maybe I will update the pekko-grpc project with your plugin too.
I put thoese files in the same place, at least works for now.
new examples
https://github.com/ascopes/protobuf-maven-plugin/tree/main/protobuf-maven-plugin/src/it/java-dependencies
https://github.com/ascopes/protobuf-maven-plugin/tree/main/protobuf-maven-plugin/src/it/java-transitive-dependency-compilation
https://github.com/ascopes/protobuf-maven-plugin/tree/main/protobuf-maven-plugin/src/it/java-direct-dependency-compilation