Here are few steps to configure protobuf-to-java compilation in your maven project:

Install google protobuf compiler on your computer.

<properties>
    <!-- You may need to specify path to protobuf compiler -->
    <protocCommand>/opt/local/bin/protoc</protocCommand>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>com.github.igor-petruk.protobuf</groupId>
            <artifactId>protobuf-maven-plugin</artifactId>
            <version>0.5.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>2.4.1</version>
    </dependency>
</dependencies>

Create protobuf definition files within /src/main/protobuf/ directory. You may want to specify the following options in .proto files.

package com.example;
option java_multiple_files = true;
option java_outer_classname = "Messages";

mvn generate-sources and you’re done!