Class ProtocTestCompileCustomMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="test-compile-custom", defaultPhase=GENERATE_TEST_SOURCES, requiresDependencyResolution=TEST, threadSafe=true) public final class ProtocTestCompileCustomMojo extends AbstractProtocTestCompileMojo
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.
Since:
0.4.1
  • Constructor Details

    • ProtocTestCompileCustomMojo

      public ProtocTestCompileCustomMojo()
  • Method Details

    • addProtocBuilderParameters

      protected void addProtocBuilderParameters(Protoc.Builder protocBuilder)
      Description copied from class: AbstractProtocMojo
      Adds mojo-specific parameters to the protoc builder.
      Overrides:
      addProtocBuilderParameters in class AbstractProtocMojo
      Parameters:
      protocBuilder - the builder to be modified.
    • getOutputDirectory

      protected File getOutputDirectory()
      Description copied from class: AbstractProtocMojo
      Returns the output directory for generated sources. Depends on build phase so must be defined in concrete implementation.
      Specified by:
      getOutputDirectory in class AbstractProtocMojo
      Returns:
      output directory for generated sources.