Converts Avro IDL files (.avdl) to Avro schema files (.avsc).
The avro-maven-plugin allows you to code generate Java classes from .avdl, .avpr or .apvsc files. Writing Avro schema files can be quite tedious with the repeated json schema syntax. It also has limited support for importing other avsc files. You have to define an import directory as a configuration parameter in the build plugin.
Avro IDL provides a concise way to describe records and rpc messages. It convenient import functionality.
This plugin leverages the power of IDL to make your life easier.
Defining RPC messages in the avdl will be of no use in this case as schema files do not contain this information.
Add the following to your maven repositories plugin:
<repository>
<id>TrivadisPF Maven Repo</id>
<url>https://github.com/TrivadisPF/avdl2avsc-maven-plugin/mvn-repo/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
Add the following to the maven build plugins:
<build>
<plugins>
<plugin>
<groupId>com.trivadispf.plugins</groupId>
<artifactId>avdl2avsc-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>genschema</goal>
</goals>
<configuration>
<inputAvdlDirectory>${basedir}/src/main/resources/avro/idl</inputAvdlDirectory>
<outputSchemaDirectory>${basedir}/target/generated-sources/avro/schema</outputSchemaDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>