@Mojo(name="avro-validate", defaultPhase=TEST, requiresProject=true) public final class SchemaValidatorMojo extends SchemaMojoBase implements ValidatorMojo
Mojo that runs all Schema validators on this project schemas
Built in validators:
By default validation issues will fail the build. This can be disabled at validator level with:
<validatorConfigs>
<[validatorName].failOnIssue></[validatorName].failOnIssue>
</validatorConfigs>
A particular validator can be sckipped at schema level with:
@ignoreValidators(["validatorname"])
Custom validators can be built and used. A custom validator, will need to implement the org.spf4j.maven.plugin.avro.avscp.validation.Validator interface, and will be loaded via the java Service Loader api.
dependenciesDirectory, generatedAvscTarget, generatedJavaTarget, mavenProject, mavenSession, repoSystem, sourceDirectory, target
Constructor and Description |
---|
SchemaValidatorMojo() |
Modifier and Type | Method and Description |
---|---|
void |
execute() |
String[] |
getSchemaFiles() |
Map<String,String> |
getValidatorConfigs() |
void |
handleValidation(Map<String,Validator.Result> vresult,
org.apache.maven.plugin.logging.Log logger,
String detail) |
String |
toString()
will be overwritten as needed, and override will include this result.
|
getGeneratedAvscTarget, getMavenProject, getMavenSession, getRepoSystem, getTarget
getLog, getPluginContext, setLog, setPluginContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getGeneratedAvscTarget, getLog, getMavenProject, getMavenSession, getRepoSystem, getTarget
public Map<String,String> getValidatorConfigs()
getValidatorConfigs
in interface ValidatorMojo
public void execute() throws org.apache.maven.plugin.MojoExecutionException
execute
in interface org.apache.maven.plugin.Mojo
org.apache.maven.plugin.MojoExecutionException
public void handleValidation(Map<String,Validator.Result> vresult, org.apache.maven.plugin.logging.Log logger, String detail) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
public String[] getSchemaFiles()
public String toString()
SchemaMojoBase
toString
in class SchemaMojoBase
Copyright © 2018 SPF4J. All rights reserved.