Plugin Documentation

This report describes goals, parameters details, requirements and sample usage of this plugin.

Goals

Goals available for this plugin:

Goal Description
protobuf:generate Generate source code from protobuf files.

This treats generated code as being part of the main source set. For test sources, use the generate-test goal instead.

Any project dependencies using the compile, provided, or system scopes will be made available to import from protobuf sources.

By default, sources will be read from src/main/protobuf, and generated sources will be written to target/generated-sources/protobuf.

protobuf:generate-test Generate source code from protobuf files for use in tests.

Unlike the generate goal, these sources will only be visible to tests, and will not be included in any final JAR of the project main sources.

Any project dependencies using the compile, provided, system, or test scopes will be made available to import from protobuf sources.

By default, sources will be read from src/test/protobuf, and generated sources will be written to target/generated-test-sources/protobuf.

Generally, you won't need to use this. It can be useful in some more specific use cases where you are only using the protobuf definitions within the context of a test.

protobuf:help Display help information on protobuf-maven-plugin.
Call mvn protobuf:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.

System Requirements

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

Maven 3.8.2
JDK 11

System Requirements History

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

Plugin Version Maven JDK
from 1.2.1 to 2.2.3 3.8.2 11
1.2.0 - 11
from 0.3.2 to 1.2.0-rc1 3.8.1 11
from 0.0.1-M1 to 0.3.1 3.8.0 11

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>io.github.ascopes</groupId>
          <artifactId>protobuf-maven-plugin</artifactId>
          <version>2.2.4-SNAPSHOT</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>io.github.ascopes</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

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