avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Wilkes <cwil...@gmail.com>
Subject Re: How should I migrate 1.4 code to avro 1.5?
Date Sat, 03 Sep 2011 00:24:09 GMT
I've never used it but try "mvn clean:clean"  Usually I just blow away
my maven repo that I'm having a problem with, in this case:
  rm -rf  /Users/williammcneill/.m2/repository/org/codehaus/mojo/exec-maven-plugin/
try that and then do the mvn build command.

On Fri, Sep 2, 2011 at 5:18 PM, W.P. McNeill <billmcn@gmail.com> wrote:
> I got a pull request on github for a change that does this. I'm looking
> through it now.
> The problem I'm having is that Maven goals fail with the following error:
> Downloading:
> http://repo1.maven.org/maven2/org/codehaus/mojo/exec-maven-plugin/1.1/exec-maven-plugin-1.1.pom
> [WARNING] Failed to create parent directories for resolution tracking file
> /Users/williammcneill/.m2/repository/org/codehaus/mojo/exec-maven-plugin/1.1/exec-maven-plugin-1.1.pom.lastUpdated
> Does this mean I have to add extra repositories to my settings.xml, or
> should those be picked up via the avro poms?
> On Fri, Sep 2, 2011 at 5:16 PM, Scott Carey <scottcarey@apache.org> wrote:
>> Some comments:
>> You should check in the *.avdl or *.avsc file that describes your MyPair
>> schema instead of the generated code.  Maven can be used to generate the
>> Java class using the avro-maven-plugin.
>> For example, add:
>> <plugin>
>>         <groupId>org.apache.avro</groupId>
>>         <artifactId>avro-maven-plugin</artifactId>
>>         <version>1.5.3</version>
>>         <executions>
>>           <execution>
>>             <id>schemas</id>
>>             <phase>generate-sources</phase>
>>             <goals>
>>               <goal>schema</goal>
>>             </goals>
>>             <configuration>
>>               <sourceDirectory>src/main/avro</sourceDirectory>
>> <outputDirectory>target/generated-sources/avro</outputDirectory>
>>             </configuration>
>>           </execution>
>>         </executions>
>>       </plugin>
>> To your pom to compile *.avsc files from src/main/avro  into
>> target/generated-sources/avro.
>> For more help on this, add the plugin above to your pom, and type:
>> 'mvn avro:help'  for basic documentation, or 'mvn avro:help –Ddetail=true'
>> for full documentation on the maven plugin.
>> Some IDE's are a little picky with this (especially Eclipse, and moreso
>> with recent versions) and you may need to manually generate the source from
>> command line or in the IDE  ('mvn generate-sources');
>> -Scott
>> On 9/2/11 2:41 PM, "W.P. McNeill" <billmcn@gmail.com> wrote:
>> I'm new to Avro. Since I'm having trouble finding simple examples online
>> I'm writing one of my own that I'm putting on github.
>> https://github.com/wpm/AvroExample
>> Hopefully, this will be of help to people like me who are also having
>> trouble finding simple code examples.
>> I want to get this compiling without of hitch in Maven. I had it running
>> with a 1.4 version of Avro, but when I changed that to 1.5, some of the code
>> no longer works. Specifically, BinaryEncoder can no longer be instantiated
>> directly because it is now an abstract class (AvroExample.java: line 33) and
>> DecoderFactory.defaultFactory is deprecated (AvroExample.java: line 41).
>> How should I modify this code so that it works with the latest and
>> greatest version of Avro?  I looked through the Release Notes, but the
>> answers weren't obvious.
>> Thanks.

View raw message