Class GenerateSchemaMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
gov.nist.secauto.metaschema.maven.plugin.AbstractMetaschemaMojo
gov.nist.secauto.metaschema.maven.plugin.GenerateSchemaMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="generate-schemas",
defaultPhase=GENERATE_RESOURCES)
public class GenerateSchemaMojo
extends AbstractMetaschemaMojo
Goal which generates XML and JSON schemas for a given set of Metaschema
modules.
-
Nested Class Summary
Nested ClassesNested 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, staleFileDirectoryFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPerforms schema generation using the provided Metaschema modules.protected StringGets the last part of the stale filename.protected booleanDetermine if inlining choice definitions is required.protected booleanDetermine if inlining definitions is required.Methods inherited from class gov.nist.secauto.metaschema.maven.plugin.AbstractMetaschemaMojo
createStaleFile, execute, getBuildContext, getClassPath, getConstraints, getEncoding, getMavenProject, getModuleSources, getModulesToGenerateFor, getMojoExecution, getOutputDirectory, getPluginArtifacts, getStaleFile, isGenerationRequired, newBindingContext, setOutputDirectory, shouldExecutionBeSkippedMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
GenerateSchemaMojo
public GenerateSchemaMojo()
-
-
Method Details
-
isInlineDefinitions
Determine if inlining definitions is required.- Returns:
trueif inlining definitions is required, orfalseotherwise
-
isInlineChoiceDefinitions
Determine if inlining choice definitions is required.- Returns:
trueif inlining choice definitions is required, orfalseotherwise
-
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:
getStaleFileNamein classAbstractMetaschemaMojo- Returns:
- the stale filename postfix
-
generate
@NonNull protected List<File> generate(@NonNull Set<IModule> modules) throws org.apache.maven.plugin.MojoExecutionException Performs schema generation using the provided Metaschema modules.- Specified by:
generatein classAbstractMetaschemaMojo- Parameters:
modules- the Metaschema modules to generate the schema for- Returns:
- the files generated during the operation
- Throws:
org.apache.maven.plugin.MojoExecutionException- if an error occurred during generation
-