logo Apache Avro Maven Plugin

Maven plugin for Avro IDL and Specific API Compilers

homepage: avro.apache.org
fresh index:
last release: 3 months ago, first release: 1 decade ago
packaging: maven-plugin
get this artifact from: cloudera central pentaho-repo
see this artifact on: search.maven.org


Display vulnerabilities (snyk): Vulnerability check

This chart shows how much is this artifact used as a dependency in other Maven artifacts in Central repository and GitHub:


select version:

Add this snippet into pom.xml inside tag <project><build><plugins>:




Switch to artifact.
goals:
avro:help

Display help information on avro-maven-plugin. Call mvn avro:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.

avro:idl-protocol (phase: generate-sources)

Generate Java classes and interfaces from AvroIDL files (.avdl)

avro:induce (phase: process-classes)

Generate Avro files (.avsc and .avpr) from Java classes or interfaces

avro:protocol (phase: generate-sources)

Generate Java classes and interfaces from Avro protocol files (.avpr)

avro:schema (phase: generate-sources)

Generate Java classes from Avro schema files (.avsc)

Often used code snippets:

<plugin>
  <groupId>org.apache.avro</groupId>
  <artifactId>avro-maven-plugin</artifactId>
  <version>${avro.version}</version>
  <executions>
    <execution>
      <id>gen-avro-classes</id>
      <phase>generate-sources</phase>
      <goals>
        <goal>idl-protocol</goal>
      </goals>
      <configuration>
        <stringType>String</stringType>
        <sourceDirectory>src/main/avdl</sourceDirectory>
      </configuration>
    </execution>
    <execution>
      <id>gen-avro-test-classes</id>
      <phase>generate-test-sources</phase>
      <goals>
        <goal>schema</goal>
      </goals>
      <configuration>
        <stringType>String</stringType>
        <sourceDirectory>src/test/avdl</sourceDirectory>
        <outputDirectory>target/generated-test-sources/avro</outputDirectory>
      </configuration>
    </execution>
  </executions>
</plugin>
<plugin>
  <groupId>org.apache.avro</groupId>
  <artifactId>avro-maven-plugin</artifactId>
  <version>${avro.version}</version>
  <executions>
    <execution>
      <phase>generate-sources</phase>
      <goals>
        <goal>schema</goal>
        <goal>protocol</goal>
        <goal>idl-protocol</goal>
      </goals>
      <configuration>
        <sourceDirectory>${project.basedir}/src/main/resources/avro</sourceDirectory>
        <stringType>String</stringType>
        <createSetters>false</createSetters>
        <enableDecimalLogicalType>true</enableDecimalLogicalType>
        <fieldVisibility>private</fieldVisibility>
      </configuration>
    </execution>
  </executions>
</plugin>
<plugin>
  <groupId>org.apache.avro</groupId>
  <artifactId>avro-maven-plugin</artifactId>
  <version>1.6.3</version>
  <dependencies>
    <dependency>
      <groupId>org.jflux</groupId>
      <artifactId>org.jflux.resource.avrogen.templates</artifactId>
      <version>${jflux.version}</version>
    </dependency>
  </dependencies>
  <executions>
    <execution>
      <phase>generate-sources</phase>
      <goals>
        <goal>schema</goal>
      </goals>
      <configuration>
        <stringType>String</stringType>
        <templateDirectory>/templates/</templateDirectory>
      </configuration>
    </execution>
  </executions>
</plugin>
<plugin>
  <groupId>org.apache.avro</groupId>
  <artifactId>avro-maven-plugin</artifactId>
  <version>1.7.4</version>
  <dependencies>
    <dependency>
      <groupId>org.jflux</groupId>
      <artifactId>org.jflux.resource.avrogen.templates</artifactId>
      <version>${jflux.version}</version>
    </dependency>
  </dependencies>
  <executions>
    <execution>
      <phase>generate-sources</phase>
      <goals>
        <goal>schema</goal>
      </goals>
      <configuration>
        <stringType>String</stringType>
        <templateDirectory>/templates/</templateDirectory>
      </configuration>
    </execution>
  </executions>
</plugin>
<plugin>
  <groupId>org.apache.avro</groupId>
  <artifactId>avro-maven-plugin</artifactId>
  <version>1.7.7</version>
  <executions>
    <execution>
      <phase>generate-sources</phase>
      <goals>
        <goal>schema</goal>
      </goals>
      <configuration>
        <sourceDirectory>${project.basedir}/src/main/avro/</sourceDirectory>
        <outputDirectory>${project.basedir}/src/main/java/</outputDirectory>
      </configuration>
    </execution>
  </executions>
</plugin>

© Jiri Pinkas 2015 - 2022. All rights reserved! Admin login To submit bugs / feature requests please use this github page
related: JavaVids | Top Java Blogs | Java školení
Apache and Apache Maven are trademarks of the Apache Software Foundation. The Central Repository is a service mark of Sonatype, Inc.