Package adams.flow.maven
Class ActorExecutionMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- adams.flow.maven.AbstractAdamsMojo
-
- adams.flow.maven.AbstractJavaGeneratorMojo
-
- adams.flow.maven.ActorExecutionMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="exec", threadSafe=true, defaultPhase=GENERATE_SOURCES, requiresDependencyResolution=COMPILE) public class ActorExecutionMojo extends AbstractJavaGeneratorMojoCalls theActorExecutionClassProducer.- 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 ActorExecutionMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddGeneratedSourcesToProjectSourceRoot()Adds any directories containing the generated classes to the appropriate Project compilation sources; eitherTestCompileSourceRootorCompileSourceRootdepending on the exact Mojo implementation of this AbstractJavaGeneratorMojo.protected voidaddResource(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.protected FileclassOutputDir()Returns the directory for the class file (including the package).protected FileclassOutputFile()Returns the full filename for the Java class to generate.protected booleangenerateCode()Generates the actual code.protected FilegetOutputDirectory()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 booleanshouldExecutionBeSkipped()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, 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:
shouldExecutionBeSkippedin classAbstractAdamsMojo- Returns:
trueto 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.MojoExecutionExceptionGenerates the actual code.- Specified by:
generateCodein 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:
addResourcein 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 thesourceTypevalue.- Specified by:
getSourcesin 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; eitherTestCompileSourceRootorCompileSourceRootdepending on the exact Mojo implementation of this AbstractJavaGeneratorMojo.- Specified by:
addGeneratedSourcesToProjectSourceRootin classAbstractJavaGeneratorMojo
-
getOutputDirectory
protected File getOutputDirectory()
Retrieves the directory where the generated files should be written to.- Specified by:
getOutputDirectoryin classAbstractAdamsMojo- Returns:
- the directory where the generated files should be written to.
-
-