Class SchemaPackageMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.spf4j.maven.plugin.avro.avscp.SchemaPackageMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="avro-package", defaultPhase=PACKAGE, requiresProject=true) public final class SchemaPackageMojo extends org.apache.maven.plugin.AbstractMojomojo that packages a schema package and avro sources and attaches them as separate artifacts.
-
-
Field Summary
Fields Modifier and Type Field Description protected FiledependenciesDirectoryThe directory where all schema dependencies (avsc, avpr, avdl) are made vailableprotected FilegeneratedAvscTargetthe destination for the generated avro schema json files (will be published along with the java code).protected FilegeneratedJavaTargetthe destination for the java generated files.protected org.apache.maven.project.MavenProjectmavenProjectprotected org.apache.maven.execution.MavenSessionmavenSessionThe current build mavenSession instance.protected org.eclipse.aether.RepositorySystemrepoSystemThe entry point to Aether, i.e.protected StringschemaArtifactClassifierthe schema artifact classifier.protected StringschemaArtifactExtensionthe schema artifact extension.protected FilesourceDirectoryThe source directory of avro files.protected Filetargetthe target folder.protected booleanuseSchemaReferencesForAvscThis option will use schema references when writing schemas that depend of schemas from other projects, instead of baking them in.
-
Constructor Summary
Constructors Constructor Description SchemaPackageMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()Children must call this.FilegetGeneratedAvscTarget()org.apache.maven.project.MavenProjectgetMavenProject()org.apache.maven.execution.MavenSessiongetMavenSession()org.eclipse.aether.RepositorySystemgetRepoSystem()String[]getSourceFiles()FilegetTarget()StringtoString()will be overwritten as needed, and override will include this result.
-
-
-
Field Detail
-
mavenProject
@Parameter(defaultValue="${project}", required=true, readonly=true) protected org.apache.maven.project.MavenProject mavenProject
-
dependenciesDirectory
@Parameter(name="dependenciesDirectory", defaultValue="${project.build.directory}/schema-dependencies", readonly=true) protected File dependenciesDirectoryThe directory where all schema dependencies (avsc, avpr, avdl) are made vailable
-
sourceDirectory
@Parameter(name="sourceDirectory", defaultValue="${basedir}/src/main/avro") protected File sourceDirectoryThe source directory of avro files. This directory is added to the classpath at schema compiling time. All files can therefore be referenced as classpath resources following the directory structure under the source directory.
-
generatedJavaTarget
@Parameter(name="generatedJavaTarget", defaultValue="${project.build.directory}/generated-sources/avro") protected File generatedJavaTargetthe destination for the java generated files.
-
generatedAvscTarget
@Parameter(name="generatedAvscTarget", defaultValue="${project.build.directory}/generated-sources/avsc") protected File generatedAvscTargetthe destination for the generated avro schema json files (will be published along with the java code).
-
target
@Parameter(name="target", defaultValue="${project.build.directory}") protected File targetthe target folder.
-
mavenSession
@Parameter(defaultValue="${session}", required=true, readonly=true) protected org.apache.maven.execution.MavenSession mavenSessionThe current build mavenSession instance.
-
useSchemaReferencesForAvsc
@Parameter(name="useSchemaReferencesForAvsc", defaultValue="false") protected boolean useSchemaReferencesForAvscThis option will use schema references when writing schemas that depend of schemas from other projects, instead of baking them in. by default (false) all schema references will be inlined.
-
schemaArtifactClassifier
@Parameter(name="schemaArtifactClassifier", defaultValue="avsc") protected String schemaArtifactClassifierthe schema artifact classifier.
-
schemaArtifactExtension
@Parameter(name="schemaArtifactExtension", defaultValue="jar") protected String schemaArtifactExtensionthe schema artifact extension.
-
repoSystem
@Component protected org.eclipse.aether.RepositorySystem repoSystem
The entry point to Aether, i.e. the component doing all the work.
-
-
Method Detail
-
getSourceFiles
public String[] getSourceFiles()
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureExceptionChildren must call this. package schemas and sources.s- Specified by:
executein interfaceorg.apache.maven.plugin.Mojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
toString
public String toString()
will be overwritten as needed, and override will include this result.
-
getRepoSystem
public final org.eclipse.aether.RepositorySystem getRepoSystem()
-
getMavenSession
public final org.apache.maven.execution.MavenSession getMavenSession()
-
getMavenProject
public final org.apache.maven.project.MavenProject getMavenProject()
-
getGeneratedAvscTarget
public final File getGeneratedAvscTarget()
-
getTarget
public final File getTarget()
-
-