avro-schema:avro-compile

Full name:

org.spf4j:maven-avro-schema-plugin:8.9.3-SNAPSHOT:avro-compile

Description:

Mojo that will compile the avro sources: *.avsc, *.avpr, *.avdl in: 1) java files. 2) avsc files.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: compile+runtime.
  • Binds by default to the lifecycle phase: generate-sources.

Optional Parameters

Name Type Since Description
<addMavenId> boolean - add maven coordinates to the schema. (group:artifact:version:ID) ID->Schema full name mapping file schema_index.properties is packaged in the jar artifacts.
Default value is: true.
<createSetters> boolean - Determines whether or not to create setters for the fields of the record. The default is to create setters.
Default value is: false.
<deleteProtocolInterface> boolean - delete Protocol java files, this is when only the schema definitions are relevant.
Default value is: true.
<fieldVisibility> String - The field visibility indicator for the fields of the generated class, as string values of SpecificCompiler.FieldVisibility. The text is case insensitive.
Default value is: PRIVATE.
<generatedAvscTarget> File - the destination for the generated avro schema json files (will be published along with the java code).
Default value is: ${project.build.directory}/generated-sources/avsc.
<generatedJavaTarget> File - the destination for the java generated files.
Default value is: ${project.build.directory}/generated-sources/avro.
<schemaArtifactClassifier> String - the schema artifact classifier.
Default value is: avsc.
<schemaArtifactExtension> String - the schema artifact extension.
Default value is: jar.
<sourceDirectory> File - The 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.
Default value is: ${basedir}/src/main/avro.
<stringType> String - string type
Default value is: String.
<systemProperties> Properties - set Java system properties that might control avro behavior.
<target> File - the target folder.
Default value is: ${project.build.directory}.
<templateDirectory> String - The directory (within the java classpath) that contains the velocity templates to use for code generation. The default value points to the templates included with the avro-maven-plugin.
Default value is: /org/apache/avro/compiler/specific/templates/java/classic/.
<useSchemaReferencesForAvsc> boolean - This 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.
Default value is: false.

Parameter Details

<addMavenId>

add maven coordinates to the schema. (group:artifact:version:ID) ID->Schema full name mapping file schema_index.properties is packaged in the jar artifacts.
  • Type: boolean
  • Required: No
  • Default: true

<createSetters>

Determines whether or not to create setters for the fields of the record. The default is to create setters.
  • Type: boolean
  • Required: No
  • Default: false

<deleteProtocolInterface>

delete Protocol java files, this is when only the schema definitions are relevant.
  • Type: boolean
  • Required: No
  • Default: true

<fieldVisibility>

The field visibility indicator for the fields of the generated class, as string values of SpecificCompiler.FieldVisibility. The text is case insensitive.
  • Type: java.lang.String
  • Required: No
  • Default: PRIVATE

<generatedAvscTarget>

the destination for the generated avro schema json files (will be published along with the java code).
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}/generated-sources/avsc

<generatedJavaTarget>

the destination for the java generated files.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}/generated-sources/avro

<schemaArtifactClassifier>

the schema artifact classifier.
  • Type: java.lang.String
  • Required: No
  • Default: avsc

<schemaArtifactExtension>

the schema artifact extension.
  • Type: java.lang.String
  • Required: No
  • Default: jar

<sourceDirectory>

The 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.
  • Type: java.io.File
  • Required: No
  • Default: ${basedir}/src/main/avro

<stringType>

string type
  • Type: java.lang.String
  • Required: No
  • Default: String

<systemProperties>

set Java system properties that might control avro behavior.
  • Type: java.util.Properties
  • Required: No

<target>

the target folder.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}

<templateDirectory>

The directory (within the java classpath) that contains the velocity templates to use for code generation. The default value points to the templates included with the avro-maven-plugin.
  • Type: java.lang.String
  • Required: No
  • Default: /org/apache/avro/compiler/specific/templates/java/classic/

<useSchemaReferencesForAvsc>

This 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.
  • Type: boolean
  • Required: No
  • Default: false