Class ProtoMojo

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

    @Mojo(name="compile",
          defaultPhase=PROCESS_SOURCES)
    public class ProtoMojo
    extends org.apache.maven.plugin.AbstractMojo
    A Maven Mojo so that the Proto compiler can be used with maven.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.File mainOutputDirectory
      The directory where the output files will be located.
      private java.io.File mainSourceDirectory
      The directory where the proto files (*.proto) are located.
      protected org.apache.maven.project.MavenProject project
      The maven project.
      private java.io.File testOutputDirectory
      The directory where the output files will be located.
      private java.io.File testSourceDirectory
      The directory where the proto files (*.proto) are located.
      private java.lang.String type
      The type of generator to run.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Constructor Summary

      Constructors 
      Constructor Description
      ProtoMojo()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()  
      private void processFiles​(java.io.File[] mainFiles, java.io.File outputDir)  
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • project

        @Parameter(property="project",
                   required=true,
                   readonly=true)
        protected org.apache.maven.project.MavenProject project
        The maven project.
      • mainSourceDirectory

        @Parameter(defaultValue="${basedir}/src/main/proto")
        private java.io.File mainSourceDirectory
        The directory where the proto files (*.proto) are located.
      • mainOutputDirectory

        @Parameter(defaultValue="${project.build.directory}/generated-sources/proto")
        private java.io.File mainOutputDirectory
        The directory where the output files will be located.
      • testSourceDirectory

        @Parameter(defaultValue="${basedir}/src/test/proto")
        private java.io.File testSourceDirectory
        The directory where the proto files (*.proto) are located.
      • testOutputDirectory

        @Parameter(defaultValue="${project.build.directory}/test-generated-sources/proto")
        private java.io.File testOutputDirectory
        The directory where the output files will be located.
      • type

        @Parameter(defaultValue="default")
        private java.lang.String type
        The type of generator to run.
    • Constructor Detail

      • ProtoMojo

        public ProtoMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • processFiles

        private void processFiles​(java.io.File[] mainFiles,
                                  java.io.File outputDir)
                           throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException