I have two .proto
files (a.proto
and b.proto
) having the same contents in them:
syntax = "proto3";
message env {
string broker = 1;
}
When I execute the compiler (I want to generate Java source files) and specify both files on the command line
protoc.exe --java_out=. a.proto b.proto
I get error messages:
b.proto:4:10: "env.broker" is already defined in file "a.proto".
b.proto:3:9: "env" is already defined in file "a.proto".
I'd expect the compiler to generate two Java classes (A
and B
), each having a nested class Env
. This is how I understand the docs. But this does not happen.
What am I doing wrong?
Thank you for any hints.