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 Metaschema modules.
-
Nested Class Summary
Nested classes/interfaces inherited from class gov.nist.secauto.metaschema.maven.plugin.AbstractMetaschemaMojo
AbstractMetaschemaMojo.LoggingValidationHandler, AbstractMetaschemaMojo.ModuleBindingGenerator
-
Field Summary
Fields inherited from class gov.nist.secauto.metaschema.maven.plugin.AbstractMetaschemaMojo
excludes, includes, staleFileDirectory
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Methods inherited from class gov.nist.secauto.metaschema.maven.plugin.AbstractMetaschemaMojo
createStaleFile, getBuildContext, getClassPath, getConstraints, getEncoding, getMavenProject, getModuleSources, getModulesToGenerateFor, getMojoExecution, getOutputDirectory, getPluginArtifacts, getStaleFile, isGenerationRequired, newBindingContext, setOutputDirectory, shouldExecutionBeSkipped
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
configs
A set of binding configurations.
-
-
Constructor Details
-
GenerateSourcesMojo
public GenerateSourcesMojo()
-
-
Method Details
-
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
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
- Throws:
org.apache.maven.plugin.MojoExecutionException
-