OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
20.73k stars 6.32k forks source link

[BUG] [JAVA] Maven 3.9.0 not compatible with openapi-generator-maven-plugin #14970

Open scarol8 opened 1 year ago

scarol8 commented 1 year ago

Bug Report Checklist

Description

I was setting up my new laptop the same way as I had been using openapi-generator in the past on my old laptop (same type - Macbook pro with same Ventura OS and m1 chip) - installing java and maven and then running my java application which uses the openapi-generator-maven-plugin. I kept getting a NPE when running "mvn clean install" on my project (which uses Java 8). My maven version was 3.9.0 (the default when running brew install maven). The only difference between my old and new laptop was this maven version. Others who were able to run the same project were using a maven version less than 3.9.0, so I changed the version to 3.8.8 and now I'm not getting the NPE.

openapi-generator version

5.1.0

OpenAPI declaration file content or url

https://mvnrepository.com/artifact/org.openapitools/openapi-generator-maven-plugin/5.1.0 Note: I don't feel comfortable sharing too much about the stacktrace and details since this is specific to my company and I don't want to inadvertently share something I shouldn't.

Generation Details

openapi-generator-maven-plugin:pom:5.1.0 Java: 1.8.0_201 maven: apache-maven-3.8.8

Steps to reproduce

Install and use maven 3.9.0 on a java 8 project - run "mvn clean install" and see Build Failure with a Null Pointer Exception (not a lot of information here). I did save the stacktrace if you want to reach out to me and we can discuss. I just don't want to share anything specific relating my company.

Related issues/PRs

none

Suggest a fix

Change maven version to 3.8.8 - this worked for me. I know others running the same project are using 3.8.8 or lower.

wing328 commented 1 year ago

5.1.0

Can you please try the latest version v6.4.0 to see if it has the same issue?

mprins commented 1 year ago

possibly also fixed w/ Maven 3.9.1 see https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12316922&version=12352872