xolstice / protobuf-maven-plugin

Maven Plugin that executes the Protocol Buffers (protoc) compiler
https://www.xolstice.org/protobuf-maven-plugin/
Other
232 stars 76 forks source link

Multiple package definitions. #33

Closed magick93 closed 6 years ago

magick93 commented 6 years ago

Am trying to generate java classes from protoc files, and get this error:

Multiple package definitions.

The proto file looks like:

syntax = "proto3";  
option java_package = "io.myco.message";
package myco;   
message UserRecordUpdateResponseMessage {

int32 int = 1;
}

From my understanding the protoc file is valid.

sergei-ivanov commented 6 years ago

This is not a maven plugin error, it is a protoc error. Have you tried compiling your proto file with a command line protoc? I wonder if the error is going to go away if you put the package instruction before the option java_package?

magick93 commented 6 years ago

I didnt try changing the order. I instead removed the java_package statement, and the error is now gone.