Plugin Documentation

Goals available for this plugin:

Goal Description
protobuf:compile This mojo executes the protoc compiler for generating main Java sources from protocol buffer definitions. It also searches dependency artifacts for .proto files and includes them in the proto_path so that they can be referenced. Finally, it adds the .proto files to the project as resources so that they are included in the final artifact.
protobuf:compile-cpp This mojo executes the protoc compiler for generating main C++ sources from protocol buffer definitions. It also searches dependency artifacts for .proto files and includes them in the proto_path so that they can be referenced. Finally, it adds the .proto files to the project as resources so that they are included in the final artifact.
protobuf:compile-csharp This mojo executes the protoc compiler for generating main C# sources from protocol buffer definitions. It also searches dependency artifacts for .proto files and includes them in the proto_path so that they can be referenced. Finally, it adds the .proto files to the project as resources so that they are included in the final artifact.
protobuf:compile-custom This mojo executes the protoc compiler with the specified plugin executable to generate main sources from protocol buffer definitions. It also searches dependency artifacts for .proto files and includes them in the proto_path so that they can be referenced. Finally, it adds the .proto files to the project as resources so that they are included in the final artifact.
protobuf:compile-javanano Deprecated. JavaNano has been deprecated in favour of Java Lite. Please see Protocol Buffers documentation for details.
protobuf:compile-js This mojo executes the protoc compiler for generating main JavaScript sources from protocol buffer definitions. It also searches dependency artifacts for .proto files and includes them in the proto_path so that they can be referenced. Finally, it adds the .proto files to the project as resources so that they are included in the final artifact.
protobuf:compile-python This mojo executes the protoc compiler for generating main python sources from protocol buffer definitions. It also searches dependency artifacts for .proto files and includes them in the proto_path so that they can be referenced. Finally, it adds the .proto files to the project as resources so that they are included in the final artifact.
protobuf:help Display help information on protobuf-maven-plugin.
Call mvn protobuf:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
protobuf:test-compile This mojo executes the protoc compiler for generating test Java sources from protocol buffer definitions. It also searches dependency artifacts in the test scope for .proto files and includes them in the proto_path so that they can be referenced. Finally, it adds the .proto files to the project as test resources so that they can be included in the test-jar artifact.
protobuf:test-compile-cpp This mojo executes the protoc compiler for generating test C++ sources from protocol buffer definitions. It also searches dependency artifacts in the test scope for .proto files and includes them in the proto_path so that they can be referenced. Finally, it adds the .proto files to the project as test resources so that they can be included in the test-jar artifact.
protobuf:test-compile-csharp This mojo executes the protoc compiler for generating test C# sources from protocol buffer definitions. It also searches dependency artifacts in the test scope for .proto files and includes them in the proto_path so that they can be referenced. Finally, it adds the .proto files to the project as test resources so that they can be included in the test-jar artifact.
protobuf:test-compile-custom This mojo executes the protoc compiler with the specified plugin executable to generate test sources from protocol buffer definitions. It also searches dependency artifacts for .proto files and includes them in the proto_path so that they can be referenced. Finally, it adds the .proto files to the project as resources so that they can be included in the test-jar artifact.
protobuf:test-compile-javanano Deprecated. JavaNano has been deprecated in favour of Java Lite. Please see Protocol Buffers documentation for details.
protobuf:test-compile-js This mojo executes the protoc compiler for generating test JavaScript sources from protocol buffer definitions. It also searches dependency artifacts in the test scope for .proto files and includes them in the proto_path so that they can be referenced. Finally, it adds the .proto files to the project as test resources so that they can be included in the test-jar artifact.
protobuf:test-compile-python This mojo executes the protoc compiler for generating test python sources from protocol buffer definitions. It also searches dependency artifacts in the test scope for .proto files and includes them in the proto_path so that they can be referenced. Finally, it adds the .proto files to the project as test resources so that they can be included in the test-jar artifact.

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 3.0
JDK 1.6
Memory No minimum requirement.
Disk Space No minimum requirement.

Usage

You should specify the version in your project's plugin configuration:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.xolstice.maven.plugins</groupId>
          <artifactId>protobuf-maven-plugin</artifactId>
          <version>0.6.1</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
        <version>0.6.1</version>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"