

It is possible to output binary FileDescriptorSet files containing all the descriptor metadata for generated classes. Note: it is important to make sure that the version of protobuf compiler is compatible with the version of protobuf java library (ideally they should be of the same version), otherwise the generated code will fail to compile.Īs soon as everything is set up, execute the following goals to build the project:

An appropriate version of :protobuf-java dependency has to be declared, or made available through POM inheritance: this is needed for compiling the generated source code.Note: test-compile goal will only be needed if there are custom protocol buffer definitions being used in your tests. However, plugin goals have default bindings to appropriate phases, therefore there is typically no need to specify phase bindings in plugin configuration. Plugin executions need to be defined, because the plugin is not part of the default lifecycle.An alternative configuration involves toolchains (described in plugin examples).

