Sometimes you are just plain lazy and would rather have Maven create the Java files out of .proto. The alternative would have been to download the protoc, fire up the terminal and issue one simple command. Not a big deal at all. But as I said sometimes you are just plain lazy.

So how do you go about it? Follow the steps given below.

Think up a super critical message that you want to send across over the wire.

If you don't know how to write a .proto file, perhaps one of the links below would help.

Create Your Message

syntax = "proto2";
// This is the package where the java source code will be placed.
option java_package = "le.arn";
// This is the name of the class.
// If not provided, it will be created as <message name>OuterClass.
option java_outer_classname = "GreetingProtos";
message Greeting {
required string greeting = 1;
}

Maven

Create a vanilla Maven project.

Say thanks to open source and add protoc-jar-maven-plugin to the project.