Class GenerateSourcesMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- gov.nist.secauto.metaschema.maven.plugin.AbstractMetaschemaMojo
-
- gov.nist.secauto.metaschema.maven.plugin.GenerateSourcesMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="generate-sources", defaultPhase=GENERATE_SOURCES) public class GenerateSourcesMojo extends AbstractMetaschemaMojo
Goal which generates Java source files for a given set of Module definitions.
-
-
Field Summary
Fields Modifier and Type Field Description protected File[]
configs
A set of binding configurations.-
Fields inherited from class gov.nist.secauto.metaschema.maven.plugin.AbstractMetaschemaMojo
excludes, includes, staleFileDirectory
-
-
Constructor Summary
Constructors Constructor Description GenerateSourcesMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
protected void
generate(Set<IModule> modules)
Generate the Java source files for the provided Metaschemas.protected List<File>
getConfigs()
Retrieve a list of binding configurations.protected String
getStaleFileName()
Gets the last part of the stale filename.-
Methods inherited from class gov.nist.secauto.metaschema.maven.plugin.AbstractMetaschemaMojo
getBuildContext, getEncoding, getMavenProject, getMojoExecution, getOutputDirectory, getSources, getStaleFile, isGenerationRequired, setOutputDirectory, shouldExecutionBeSkipped
-
-
-
-
Constructor Detail
-
GenerateSourcesMojo
public GenerateSourcesMojo()
-
-
Method Detail
-
getStaleFileName
protected String getStaleFileName()
Gets the last part of the stale filename.
The full stale filename will be generated by pre-pending
"." + getExecution().getExecutionId()
to this staleFileName.- Specified by:
getStaleFileName
in classAbstractMetaschemaMojo
- Returns:
- the stale filename postfix
-
getConfigs
protected List<File> getConfigs()
Retrieve a list of binding configurations.- Returns:
- the collection of binding configurations
-
generate
protected void generate(@NonNull Set<IModule> modules) throws org.apache.maven.plugin.MojoExecutionException
Generate the Java source files for the provided Metaschemas.- Parameters:
modules
- the collection of Metaschema modules to generate sources for- Throws:
org.apache.maven.plugin.MojoExecutionException
- if an error occurred while generating sources
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-