AVRO-1524: avro-maven-plugin be able to generate schema from IDL
What is the purpose of the change
Implement AVRO-1524: update avro-maven-plugin to generate schema from IDL
Verifying this change
This change consists of several parts:
- The new avro-maven-plugin configurations, plus tests
- Documentation (1 file)
All changes have tests.
Documentation
- Does this pull request introduce a new feature? (yes / ~no~)
- If yes, how is the feature documented? (~not applicable~ / docs / ~JavaDocs~ / ~not documented~)
Thank you for implementing this!
The idea is good, but plugin mojos should have one task.
Can you please create separate mojos for each of the two new actions?
Thank you for implementing this!
The idea is good, but plugin mojos should have one task.
Can you please create separate mojos for each of the two new actions?
Agree that plugin mojos should have single responsibility. But the mojo names confused me.
Since https://github.com/apache/avro/pull/1589, we have:
- IDLMojo - @goal idl - Generate Java classes and interfaces from AvroIDL files (.avdl)
- IDLProtocolMojo - @goal idl-protocol - The old version of IDLMojo
IDLMojo looks like a generic IDL tool so I added the new actions to it. I think it would be clearer if it had a more meaningful name likes IDL2JavaMojo
And the new Mojos might be:
-
IDL2ProtocolMojo- @goal idl-2-protocol - Generate Json protocol from Avro IDL files (.avdl) -
IDL2SchemaMojo- @goal idl-2-schema - Generate Json Schema from Avro IDL files (.avdl) Are they OK?
Since #1589, we have:
- IDLMojo - @goal idl - Generate Java classes and interfaces from AvroIDL files (.avdl)
- IDLProtocolMojo - @goal idl-protocol - The old version of IDLMojo
IDLMojolooks like a generic IDL tool so I added the new actions to it. I think it would be clearer if it had a more meaningful name likesIDL2JavaMojoAnd the new Mojos might be:
IDL2ProtocolMojo- @goal idl-2-protocol - Generate Json protocol from Avro IDL files (.avdl)IDL2SchemaMojo- @goal idl-2-schema - Generate Json Schema from Avro IDL files (.avdl) Are they OK?
Looks good, but I'm not a fan of the -2- infix; it looks like a separate number. I prefer this without the dashes, but -to- as infix works as well.
Given that #1589 hasn't been released yet, what do you think of the following:
-
IDL2JavaMojo- @goal idl2java - Generate Java classes and interfaces from AvroIDL files (.avdl) -
IDLProtocolMojo- @goal idl-protocol - The old version of IDLMojo -
IDL2ProtocolMojo- @goal idl2protocol - Generate Json protocol from Avro IDL files (.avdl) -
IDL2SchemaMojo- @goal idl2schema - Generate Json Schema from Avro IDL files (.avdl)
Thanks for your comment. Just pushed some updates. Please help to take a look if you have time @opwvhk
Thank @opwvhk for your approval. May I ask how to merge it to main?
Any chance of getting this feature into a release soon?