Package org.apache.hadoop.maven.plugin.protoc

Plugins to generate Java files based on protocol buffers with the protoc command.

See: Description

Package org.apache.hadoop.maven.plugin.protoc Description

Plugins to generate Java files based on protocol buffers with the protoc command.

For generated files intended for primary build artifacts use like:

  <plugins>
    ... SNIP ...
    <plugin>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-maven-plugins</artifactId>
      <executions>
        ... SNIP ...
        <execution>
          <id>compile-protoc</id>
          <goals>
            <goal>protoc</goal>
          </goals>
          <configuration>
            <protocVersion>${protobuf.version}</protocVersion>
            <protocCommand>${protoc.path}</protocCommand>
            <imports>
              <param>${basedir}/src/main/proto</param>
            </imports>
            <source>
              <directory>${basedir}/src/main/proto</directory>
              <includes>
                <include>HAServiceProtocol.proto</include>
                ... SNIP ...
                <include>RefreshCallQueueProtocol.proto</include>
                <include>GenericRefreshProtocol.proto</include>
              </includes>
            </source>
          </configuration>
        </execution>
        ... SNIP ...
      </executions>
      ... SNIP ...
    </plugin>
  </plugins>
 
For generated files intended only for test, use like:
  <plugins>
    ... SNIP ...
    <plugin>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-maven-plugins</artifactId>
      <executions>
        ... SNIP ...
        <execution>
          <id>compile-test-protoc</id>
          <goals>
            <goal>test-protoc</goal>
          </goals>
          <configuration>
            <protocVersion>${protobuf.version}</protocVersion>
            <protocCommand>${protoc.path}</protocCommand>
            <imports>
              <param>${basedir}/src/test/proto</param>
            </imports>
            <source>
              <directory>${basedir}/src/test/proto</directory>
              <includes>
                <include>test.proto</include>
                <include>test_rpc_service.proto</include>
              </includes>
            </source>
          </configuration>
        </execution>
        ... SNIP ...
      </executions>
      ... SNIP ...
    </plugin>
  </plugins>
 

Copyright © 2020 Apache Software Foundation. All rights reserved.