在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):alexholmes/avro-maven开源软件地址(OpenSource Url):https://github.com/alexholmes/avro-maven开源编程语言(OpenSource Language):开源软件介绍(OpenSource Introduction):Avro MavenSome simple examples of how to use the Avro Maven plugin to generate Avro sources given an Avro schema, protocol or IDL file. LicenseApache version 2.0 (for more details look at LICENSE. UsageDownload the sources:
Run Avro's code generation against the Avro files contained in src/main/avro ( weather.avsc, weather.avpr and weather.avdl ) using Maven: $ cd avro-maven/
$ mvn clean compile Examine the code-generated sources: $ find . -type f -name *.java src/main/java/com/alexholmes/avro/Weather.java
./target/generated-sources/avro/com/alexholmes/avro/Weather.java
./target/generated-sources/avro/com/alexholmes/avro/weatherstation1/Station.java
./target/generated-sources/avro/com/alexholmes/avro/weatherstation1/WeatherStation.java
./target/generated-sources/avro/com/alexholmes/avro/weatherstation2/Simple.java
./target/generated-sources/avro/com/alexholmes/avro/weatherstation2/WeatherStation.java The MagicThe complete Maven file can be viewed in pom.xml. The key is in adding the following plugin to your
You'll also need to include Avro as a dependency:
Customizing the pluginIf you want to customize the location of the source or destination files, as well as other settings, take a look at pom-schema-fulldefs.xml, as well as my blog post giving more details on the subject at http://grepalex.com/2013/05/24/avro-maven/. To see the customized pom.xml in action, use the following command: $ mvn clean compile -f pom-schema-fulldefs.xml The generated output files can be seen with the $ find . -type f -name *.java
./src/main/altjava/com/alexholmes/avro/Weather.java
./src/test/altjava/com/alexholmes/avro/Test.java |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论