Unable to invoke avro-maven plugin

后端 未结 4 1777
星月不相逢
星月不相逢 2021-01-18 21:26

My question is similar to Unable to compile and create .avro file from .avsc using Maven

I have tried all possible things, checked the maven project 100 times, still

4条回答
  •  鱼传尺愫
    2021-01-18 21:57

    I publish a simple demo which is fully tested and 100% works https://github.com/xmeng1/avro-maven-demo. There are two important things for generating code by using the Avro

    1. The configuration: if we want to generate code when mvn compile or mvn package, we can put configuration under the execution. If we want to generate code when running goal mvn avro:scheme, we need put the configuration to the plugin directly. (the demo includes two type configuration)
    2. The namespace of the scheme file which will decide which package the generate code will belong to. {"namespace": "com.xx.xx.demo", "name": "Foo"}, the Foo.java will be created under the package com.xx.xx.demo

提交回复
热议问题