Package org.synchronoss.cpo.plugin
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 -
Method Summary
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
GenerateJavaSources
public GenerateJavaSources()Creates the mojo. Maven populates its@Parameterfields via reflection.
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionExceptionLoads the configured CPO meta XML file(s), and for each matchingCpoClassgenerates the requested interface and/or class source file under the configured output directory.- Throws:
org.apache.maven.plugin.MojoExecutionException- if neithergenerateInterfacenorgenerateClassis set, the config file/directory can't be found, an output directory can't be created, or source generation otherwise fails
-