You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Andrea (Jira)" <ji...@apache.org> on 2022/05/04 15:17:00 UTC
[jira] [Commented] (AVRO-3019) avro-maven-pugin doesn't pick up imports
[ https://issues.apache.org/jira/browse/AVRO-3019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17531782#comment-17531782 ]
Andrea commented on AVRO-3019:
------------------------------
I had the same problem when building with 'mvn avro:schema' (but not when building with 'mvn package') and found this solution to move the configuration two levels up from the execution tag to the plugin tag:
[https://stackoverflow.com/questions/68503220/apache-avro-maven-plugin-seems-to-be-ignoring-config]
> avro-maven-pugin doesn't pick up imports
> ----------------------------------------
>
> Key: AVRO-3019
> URL: https://issues.apache.org/jira/browse/AVRO-3019
> Project: Apache Avro
> Issue Type: Bug
> Affects Versions: 1.10.0
> Reporter: Vik Gamov
> Priority: Major
>
> hello team
> For some reason, I can't make `avro-maven-plugin` to pickup imports.
> I need to refer one schema in another (attached schemas)
> Here's what I have:
> Maven plugin configuration
> {{{\{ <configuration> }}}}
> \{{ <sourceDirectory>${project.basedir}/src/main/avro/</sourceDirectory>}}
> \{{ <imports>}}
> \{{ <import>${project.basedir}/src/main/avro/transaction.avsc</import>}}
> \{{ <import>${project.basedir}/src/main/avro/funds.avsc</import>}}
> \{{ <import>${project.basedir}/src/main/avro/transaction_result.avsc</import>}}
> \{{ </imports>}}
> \{{ <outputDirectory>${project.build.directory}/generated/src/main/java/</outputDirectory>}}
> \{{ <stringType>String</stringType>}}
> \{{ <enableDecimalLogicalType>true</enableDecimalLogicalType>}}
> {{{\{ </configuration>}}}}
>
> after I run
> {{mvn avro:schema}}
>
> I'm getting (obviously)
> {{Failed to execute goal org.apache.avro:avro-maven-plugin:1.10.1:schema (default-cli) on project chapter12: Execution default-cli of goal org.apache.avro:avro-maven-plugin:1.10.1:schema failed: "Transaction" is not a defined name. The type of the "transaction" field must be a defined name or a \{"type": ...} expression.}}
>
> Kindly point me if I'm doing something wrong.
> Thank you
>
> p.s. I'm essentially trying to reproduce what was described in this blog [https://feitam.es/use-of-avro-maven-plugin-with-complex-schemas-defined-in-several-files-to-be-reused-in-different-typed-messages/]
--
This message was sent by Atlassian Jira
(v8.20.7#820007)