java.lang.Object
org.apache.maven.plugin.AbstractMojo
dev.metaschema.maven.plugin.AbstractMetaschemaMojo
dev.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 dev.metaschema.maven.plugin.AbstractMetaschemaMojo
AbstractMetaschemaMojo.LoggingValidationHandler, AbstractMetaschemaMojo.ModuleBindingGenerator -
Field Summary
FieldsFields inherited from class dev.metaschema.maven.plugin.AbstractMetaschemaMojo
excludes, includes, staleFileDirectoryFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGenerate the Java source files for the provided Metaschemas.Retrieve a list of binding configurations.protected StringGets the last part of the stale filename.Methods inherited from class dev.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
-
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:
getStaleFileNamein classAbstractMetaschemaMojo- Returns:
- the stale filename postfix
-
getConfigs
Retrieve a list of binding configurations.- Returns:
- the collection of binding configurations
-
generate
@NonNull protected List<File> generate(@NonNull Set<dev.metaschema.core.model.IModule> modules) throws org.apache.maven.plugin.MojoExecutionException Generate the Java source files for the provided Metaschemas.- Specified by:
generatein classAbstractMetaschemaMojo- Parameters:
modules- the collection of Metaschema modules to generate sources for- Returns:
- the list of generated Java source files
- Throws:
org.apache.maven.plugin.MojoExecutionException- if an error occurred while generating sources
-