simonk-wh commented on code in PR #1908:
URL: https://github.com/apache/avro/pull/1908#discussion_r1019300865
##########
lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/AbstractAvroMojo.java:
##########
@@ -192,6 +192,14 @@ public abstract class AbstractAvroMojo extends
AbstractMojo {
*/
protected boolean enableDecimalLogicalType;
+ /**
+ * Transformations to be applied when converting an Avro namespace to a Java
+ * package-name. Values are of format "namespacePrefix->packageName"
+ *
+ * @parameter property="namespaceMappings"
+ */
+ protected String[] namespaceMappings = new String[0];
Review Comment:
This is consistent with the other fields on this class. It's the way that
Maven's configuration-injection works AFAIK.
What is potentially questionable is the use of a plain string in format
"namespaceprefix->packagename". Instead, I think it is possible to define a
type with 2 fields (namespacePrefix, packageName), and then this
namespaceMappings could be an array of that type. The XML would then be not
this:
```
<namespaceMappings>
<namespaceMapping>foo->bar</namespaceMapping>
</namespaceMappings>
```
but instead
```
<namespaceMappings>
<namespaceMapping>
<namespacePrefix>foo</namespacePrefix>
<packageName>bar</packageName>
</namespaceMapping>
</namespaceMappings>
```
More verbose, and I'm not 100% sure Maven can support that, but I could try
if the "foo->bar" syntax is considered too ugly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]