Class ProtoCompilerMojo

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

@Mojo(name="compile", configurator="include-project-dependencies", requiresDependencyResolution=COMPILE_PLUS_RUNTIME) public class ProtoCompilerMojo extends org.apache.maven.plugin.AbstractMojo
Compiles proto files to java/gwt/etc.
  • Field Details

    • GENERATE_TEST_SOURCES_PHASE

      public static final String GENERATE_TEST_SOURCES_PHASE
      See Also:
    • project

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

      @Parameter(property="protostuff.compiler.skip", defaultValue="false") private boolean skip
      When true, skip the execution.
      Since:
      1.0.1
    • cacheProtos

      @Parameter(property="protostuff.compiler.cache_protos", defaultValue="false") private boolean cacheProtos
      When true, the protos are cached for re-use. This matters when a certain proto is also used/imported by other modules.
      Since:
      1.0.5
    • forceMojoExecution

      @Parameter(property="protostuff.compiler.force", defaultValue="false", required=true) private boolean forceMojoExecution
      Usually most of protostuff mojos will not get executed on parent poms (i.e. projects with packaging type 'pom'). Setting this parameter to true will force the execution of this mojo, even if it would usually get skipped in this case.
      Since:
      1.0.1
    • modulesFile

      @Parameter protected File modulesFile
      The properties file that contains the modules
    • sourceBaseDir

      @Parameter protected File sourceBaseDir
      If not specified, the directory where the file is located will be used as its base dir.

      This is only relevent when is provided.

      Since:
      1.0.8
    • outputBaseDir

      @Parameter protected File outputBaseDir
      If not specified, the directory where the file is located will be used as its base dir.

      This is only relevent when is provided.

      Since:
      1.0.8
    • protoModules

      @Parameter protected ProtoModule[] protoModules
      The modules to generate code from
    • baseDir

      @Parameter(property="project.basedir", required=true) protected File baseDir
      Maven module base directory
    • properties

      @Parameter protected Properties properties
      Plugin properties that are passed to the compiler
      Since:
      1.3.1
    • execution

      @Component private org.apache.maven.plugin.MojoExecution execution
    • systemPropertiesBackup

      private Properties systemPropertiesBackup
  • Constructor Details

    • ProtoCompilerMojo

      public ProtoCompilerMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • updateRelativeOutputLocation

      private void updateRelativeOutputLocation(ProtoModule m)
    • setSystemProperties

      private void setSystemProperties()
    • resetSystemProperties

      private void resetSystemProperties()
    • skipMojo

      protected boolean skipMojo()

      Determine if the mojo execution should get skipped.

      This is the case if:
      • skip is true
      • if the mojo gets executed on a project with packaging type 'pom' and forceMojoExecution is false
      Returns:
      true if the mojo execution should be skipped.
      Since:
      1.0.1