Apache Avro 介绍

Download

Avro implementations for C, C++, C#, Java, PHP, Python, and Ruby can be downloaded from the Apache Avro™ Releases page. This guide uses Avro 1.7.7, the latest version at the time of writing. For the examples in this guide, download avro-1.7.7.jar and avro-tools-1.7.7.jar. The Avro Java implementation also depends on the Jackson JSON library. From the Jackson download page, download the core-asl and mapper-asl jars. Add avro-1.7.7.jar and the Jackson jars to your project’s classpath (avro-tools will be used for code generation).

Alternatively, if you are using Maven, add the following dependency to your POM:


<dependency>
  <groupId>org.apache.avrogroupId>
  <artifactId>avroartifactId>
  <version>1.7.7version>
dependency>

As well as the Avro Maven plugin (for performing code generation):

<plugin>
  <groupId>org.apache.avrogroupId>
  <artifactId>avro-maven-pluginartifactId>
  <version>1.7.7version>
  <executions>
    <execution>
      <phase>generate-sourcesphase>
      <goals>
        <goal>schemagoal>
      goals>
      <configuration>
        <sourceDirectory>${project.basedir}/src/main/avro/sourceDirectory>
        <outputDirectory>${project.basedir}/src/main/java/outputDirectory>
      configuration>
    execution>
  executions>
plugin>
<plugin>
  <groupId>org.apache.maven.pluginsgroupId>
  <artifactId>maven-compiler-pluginartifactId>
  <configuration>
    <source>1.6source>
    <target>1.6target>
  configuration>
plugin>

You may also build the required Avro jars from source. Building Avro is beyond the scope of this guide; see the Build Documentation page in the wiki for more information.

你可能感兴趣的:(avro)