[ 
https://issues.apache.org/jira/browse/AVRO-3805?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17745608#comment-17745608
 ] 

Christophe Le Saec commented on AVRO-3805:
------------------------------------------

Strange, see [this code 
source|https://github.com/apache/avro/blob/master/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/AbstractAvroMojo.java#L229-L232],
 if your pom.xml file also define a source directory after the imports, as :
{code:xml}
<sourceDirectory>${project.build.directory}</sourceDirectory>
{code}
it should treat it. 

That was the case under my local computer, it generated MyApplicationEvent.java 
class,
{code:java}
...
@org.apache.avro.specific.AvroGenerated
public class MyApplicationEvent extends 
org.apache.avro.specific.SpecificRecordBase implements 
org.apache.avro.specific.SpecificRecord {
  private static final long serialVersionUID = 8809060827102281605L;
...
{code}




> Unable to generate AVRO classes with Java source generated from OpenAPI Yaml 
> file
> ---------------------------------------------------------------------------------
>
>                 Key: AVRO-3805
>                 URL: https://issues.apache.org/jira/browse/AVRO-3805
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.11.2
>            Reporter: Tom
>            Assignee: Christophe Le Saec
>            Priority: Minor
>         Attachments: demo.zip, only_one.png
>
>
> I was unable to generate AVRO classes when using OpenAPI yaml file to 
> generate the source code for avro-maven-plugin
> [INFO] BUILD FAILURE
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time:  9.450 s
> [INFO] Finished at: 2023-07-19T14:16:26-04:00
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal 
> org.apache.avro:avro-maven-plugin:1.11.2:schema (default) on project demo: 
> Execution default of goal org.apache.avro:avro-maven-plugin:1.11.2:schema 
> failed: Undefined name: "model.DocumentInfo" -> 
> This occurs when an array is specified In the OpenAPI yaml file as a property 
> of an object, for example
> documents:
> type: array
> items:
> $ref: '#/components/schemas/DocumentInfo'
>  
> If that was commented out, then proper AVRO classes will be generated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to