I have a .proto
file definition which needs to import "google/protobuf/descriptor.proto"
because I use Custom Options.
So in my .proto
file I do:
import "google/protobuf/descriptor.proto";
package ...;
...
Since my file didn't compile complaining about the dependency, I got a copy of the descriptor.proto file placing it in the same directory my proto file was.
This solved the problem but I don't believe this is the correct way. Now the descriptor.proto
gets compiled together with my .proto
file resulting in having 2 compiled descriptor.proto
at runtime:
- the one shipped with the
protobuf-java-2.5.0.jar
file - the one which was compiled together with my
.proto
file
I think the --proto-path
option should be used somehow but not entirely sure what is the correct way.
Thanks for the best practise tip here!