I need to generate files from .avsc file (avro) in ANT build. I'm not sure what plugin should I use for this. I tried with xjc.XJC2Task for generating the files but it seem to not work. Can some one suggest what plugin / class should I use to generate the files from avro schema in ANT ?
Tried with xjc:
<target name="generate" description="generate">
<mkdir dir="generated" />
<taskdef name="xjc" classname="com.sun.tools.xjc.XJC2Task" classpathref="classpath"/>
<xjc destdir="generated">
<schema dir="setup/kafka" includes="*.avsc" />
</xjc>
</target>
Error:
generate:
[xjc] Consider using <depends>/<produces> so that XJC won't do unnecessary compilation
[xjc] Compiling file:/D:/2019/My-workspace/my-project/setup/kafka/Sample.avsc
[xjc] [ERROR] Content is not allowed in prolog.
[xjc] line 1 of file:/D:/2019/My-workspace/my-project/setup/kafka/Sample.avsc
[xjc] failure in the XJC task. Use the Ant -verbose switch for more details
Used java jar command to compile the avro-tools jar . it worked.