Class ProtocTestCompileCppMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="test-compile-cpp",
          defaultPhase=GENERATE_TEST_SOURCES,
          requiresDependencyResolution=TEST,
          threadSafe=true)
    public final class ProtocTestCompileCppMojo
    extends AbstractProtocTestCompileMojo
    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.
    Since:
    0.3.3
    • Field Detail

      • outputDirectory

        @Parameter(required=true,
                   property="cppTestOutputDirectory",
                   defaultValue="${project.build.directory}/generated-test-sources/protobuf/cpp")
        private java.io.File outputDirectory
        This is the directory into which the .cpp test sources will be created.
    • Constructor Detail

      • ProtocTestCompileCppMojo

        public ProtocTestCompileCppMojo()
    • Method Detail

      • getOutputDirectory

        protected java.io.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.