Class GenerateJavaSources

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

@Mojo(name="generatejavasource", requiresDependencyResolution=COMPILE_PLUS_RUNTIME, defaultPhase=GENERATE_SOURCES) public class GenerateJavaSources extends org.apache.maven.plugin.AbstractMojo
Maven goal (cpo:generatejavasource) that reads one or more CPO meta XML files and generates the corresponding Java interface and/or class source files, adding the generated directory to the project's compile (or test-compile) source roots.

Which source kinds are generated is controlled by generateInterface and generateClass; when only a class is generated (no interface), CpoLegacyClassSourceGenerator is used instead of CpoClassSourceGenerator so the class stands alone without an accompanying interface.

  • Field Summary

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the mojo.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Loads the configured CPO meta XML file(s), and for each matching CpoClass generates the requested interface and/or class source file under the configured output directory.

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GenerateJavaSources

      public GenerateJavaSources()
      Creates the mojo. Maven populates its @Parameter fields via reflection.
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException
      Loads the configured CPO meta XML file(s), and for each matching CpoClass generates the requested interface and/or class source file under the configured output directory.
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if neither generateInterface nor generateClass is set, the config file/directory can't be found, an output directory can't be created, or source generation otherwise fails