Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Avro >> mail # user >> Code Generation from avsc files

Copy link to this message
Re: Code Generation from avsc files
I think your plugin configuration might be missing some lines.

Here's what mine looks like:



I don't know if the compiler works with avsc files but assuming it does,
you'll probably need to either change or add an appropriate include:
<include> *.avsc</include>
You'll also want to change the sourcedirectory to the directory where your
schema files are located.

On Fri, Mar 30, 2012 at 6:32 AM, Deepak Nettem <[EMAIL PROTECTED]>wrote:

> Hi,
> I have a .avsc schema file in my maven project, and I am able to use it to
> write simple avro apps. However, I am not able to generate source code
> (classes) from the avro schema file to be able to use them in Avro
> MapReduce code.
> My pom.xml plugins section looks like this:
>     <plugins>
>     <plugin>
>             <artifactId>maven-assembly-plugin</artifactId>
>             <configuration>
>                 <archive>
>                     <manifest>
>                         <mainClass>org.avrotest.App</mainClass>
>                     </manifest>
>                 </archive>
>                  <manifestEntries>
>           <Class-Path>../target/classes</Class-Path>
>         </manifestEntries>
>                 <descriptorRefs>
>                     <descriptorRef>jar-with-dependencies</descriptorRef>
>                 </descriptorRefs>
>             </configuration>
>         </plugin>
>      <plugin>
>         <groupId>org.apache.avro</groupId>
>         <artifactId>avro-maven-plugin</artifactId>
>         <version>1.6.1</version>
>       </plugin>
>     </plugins>
> I package my jar by running
> mvn compile
> mvn assembly:single
> Best,
> Deepak