Package io.permazen.maven
Class AbstractSchemaMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
io.permazen.maven.AbstractSchemaMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractMainSchemaMojo
public abstract class AbstractSchemaMojo
extends org.apache.maven.plugin.AbstractMojo
Generates a schema XML file from a set of Permazen model classes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]Specifies the names of specific Java classes to search for @PermazenTypeannotations.protected StringTheEncodingRegistryto use for looking up field encodings.protected String[]Specifies Java package names under which to search for classes with @PermazenTypeannotations.protected org.apache.maven.project.MavenProjectprotected StringThe name of a Maven property to set to the auto-generated schema ID.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddDependencyClasspathElements(List<String> elements) final voidexecute()protected abstract voidexecute(SchemaUtility schemaUtility) protected abstract FileMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
packages
Specifies Java package names under which to search for classes with @PermazenTypeannotations.If no
<classes>or<packages>are configured, then by default this plugin searches all classes in the output directory. -
classes
Specifies the names of specific Java classes to search for @PermazenTypeannotations.If no
<classes>or<packages>are configured, then by default this plugin searches all classes in the output directory. -
encodingRegistryClass
The
EncodingRegistryto use for looking up field encodings. By default, aDefaultEncodingRegistryis used.To configure a custom
EncodingRegistry, specify its class name like this:
The specified class (<configuration> <encodingRegistryClass>com.example.MyEncodingRegistry</encodingRegistryClass> ... </configuration>com.example.MyEncodingRegistryin this example) must be available either as part of the project being built or in one of the project's dependencies. -
schemaIdProperty
The name of a Maven property to set to the auto-generated schema ID. This is a string that is a unique hash of the schema and which looks like"Schema_12e983a72e72ed56741ddc45e47d3377". -
project
@Parameter(defaultValue="${project}", readonly=true) protected org.apache.maven.project.MavenProject project
-
-
Constructor Details
-
AbstractSchemaMojo
public AbstractSchemaMojo()
-
-
Method Details
-
getClassOutputDirectory
-
addDependencyClasspathElements
protected abstract void addDependencyClasspathElements(List<String> elements) throws org.apache.maven.artifact.DependencyResolutionRequiredException - Throws:
org.apache.maven.artifact.DependencyResolutionRequiredException
-
execute
protected abstract void execute(SchemaUtility schemaUtility) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException - Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
execute
public final void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-