Package adams.flow.maven
Class ApplyActorMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- adams.flow.maven.AbstractAdamsMojo
-
- adams.flow.maven.AbstractJavaGeneratorMojo
-
- adams.flow.maven.ApplyActorMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="apply", threadSafe=true, defaultPhase=GENERATE_SOURCES, requiresDependencyResolution=COMPILE) public class ApplyActorMojo extends AbstractJavaGeneratorMojo
Calls theApplyActorProducer
.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
-
Fields inherited from class adams.flow.maven.AbstractJavaGeneratorMojo
environmentClass, packageName
-
Fields inherited from class adams.flow.maven.AbstractAdamsMojo
NEWLINE
-
-
Constructor Summary
Constructors Constructor Description ApplyActorMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addGeneratedSourcesToProjectSourceRoot()
Adds any directories containing the generated classes to the appropriate Project compilation sources; eitherTestCompileSourceRoot
orCompileSourceRoot
depending on the exact Mojo implementation of this AbstractJavaGeneratorMojo.protected void
addResource(org.apache.maven.model.Resource resource)
Adds the supplied Resource to the project using the appropriate scope (i.e.protected File
classOutputDir()
Returns the directory for the class file (including the package).protected File
classOutputFile()
Returns the full filename for the Java class to generate.protected boolean
generateCode()
Generates the actual code.protected File
getOutputDirectory()
Retrieves the directory where the generated files should be written to.protected List<URL>
getSources()
Override this method to acquire a List holding all URLs to the sources for which this AbstractJavaGeneratorMojo should generate Java files.protected boolean
shouldExecutionBeSkipped()
Implement this method to check if this AbstractAdamsMojo should skip executing altogether.-
Methods inherited from class adams.flow.maven.AbstractJavaGeneratorMojo
isReGenerationRequired, performExecution
-
Methods inherited from class adams.flow.maven.AbstractAdamsMojo
execute, getBuildContext, getClasspath, getExecution, getProject, logSystemPropertiesAndBasedir, warnAboutIncorrectPluginConfiguration
-
-
-
-
Method Detail
-
shouldExecutionBeSkipped
protected boolean shouldExecutionBeSkipped()
Implement this method to check if this AbstractAdamsMojo should skip executing altogether.- Specified by:
shouldExecutionBeSkipped
in classAbstractAdamsMojo
- Returns:
true
to indicate that this AbstractAdamsMojo should bail out of its execute method.
-
classOutputDir
protected File classOutputDir()
Returns the directory for the class file (including the package).- Returns:
- the directory
-
classOutputFile
protected File classOutputFile()
Returns the full filename for the Java class to generate.- Returns:
- the filename
-
generateCode
protected boolean generateCode() throws org.apache.maven.plugin.MojoExecutionException
Generates the actual code.- Specified by:
generateCode
in classAbstractJavaGeneratorMojo
- Returns:
- true if successfully generated
- Throws:
org.apache.maven.plugin.MojoExecutionException
- if code generation fails
-
addResource
protected void addResource(org.apache.maven.model.Resource resource)
Adds the supplied Resource to the project using the appropriate scope (i.e. resource or testResource) depending on the exact implementation of this AbstractAdamsMojo.- Specified by:
addResource
in classAbstractAdamsMojo
- Parameters:
resource
- The resource to add.
-
getSources
protected List<URL> getSources()
Override this method to acquire a List holding all URLs to the sources for which this AbstractJavaGeneratorMojo should generate Java files. Sources are assumed to be in the form given by thesourceType
value.- Specified by:
getSources
in classAbstractJavaGeneratorMojo
- Returns:
- A non-null List holding URLs to sources for the code generation.
-
addGeneratedSourcesToProjectSourceRoot
protected void addGeneratedSourcesToProjectSourceRoot()
Adds any directories containing the generated classes to the appropriate Project compilation sources; eitherTestCompileSourceRoot
orCompileSourceRoot
depending on the exact Mojo implementation of this AbstractJavaGeneratorMojo.- Specified by:
addGeneratedSourcesToProjectSourceRoot
in classAbstractJavaGeneratorMojo
-
getOutputDirectory
protected File getOutputDirectory()
Retrieves the directory where the generated files should be written to.- Specified by:
getOutputDirectory
in classAbstractAdamsMojo
- Returns:
- the directory where the generated files should be written to.
-
-