[ 
https://issues.apache.org/jira/browse/AVRO-3019?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vik Gamov updated AVRO-3019:
----------------------------
    Description: 
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/]

  was:
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/


> 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.3.4#803005)

Reply via email to