@Mojo(name="verify", defaultPhase=PROCESS_CLASSES, requiresDependencyResolution=COMPILE_PLUS_RUNTIME, threadSafe=true) public class VerifySchemaMojo extends AbstractMainSchemaMojo
This goal verifies that the JSimpleDB schema can be successfully auto-generated from user-supplied model classes.
It also checks that the schema will not lead to any SchemaMismatchExceptions at runtime.
Such exceptions occur when either:
The first case is detected by having an expected schema XML file. This file corresponds to the project's
currently configured JSimpleDB schema version number (which is used to configure JSimpleDB at runtime).
It is used to verify that the schema auto-generated from the project's current model classes has not changed
in an incompatible way, which would cause an error at runtime.
In other words, the actual schema generated from the compiled classes is verified to match
what is expected, which is recorded in this file.
The current expected schema XML file location is configured by <expectedSchemaFile>;
The second case it detected by supplying XML files containing any old schema versions that are still active
in the old schema files directory. All files ending in .xml found anywhere under this
directory are checked for incompatibilities with the current schema version.
The old schema XML files directory is configured by <oldSchemasDirectory>.
If this goal fails due to an incompatibility of the first type:
<actualSchemaFile>)
should be copied to the current expected schema XML file;
If this goal fails due to an incompatibility of the second type, you must adjust your model classes to make
them compatible again. For example, manually reassign the conflicting field a different
name() or storageId()
using the JField annotation.
| Modifier and Type | Field and Description |
|---|---|
static String |
OLD_SCHEMAS_DEFAULT |
classes, packages, project, storageIdGeneratorClass| Constructor and Description |
|---|
VerifySchemaMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
execute(JSimpleDB jdb) |
addDependencyClasspathElements, getClassOutputDirectoryexecute, generate, verify, verifygetLog, getPluginContext, setLog, setPluginContextpublic static final String OLD_SCHEMAS_DEFAULT
protected void execute(JSimpleDB jdb) throws MojoExecutionException, MojoFailureException
execute in class AbstractSchemaMojoMojoExecutionExceptionMojoFailureExceptionCopyright © 2016. All rights reserved.