OpenAPITools / OpenAPITools/openapi-generator

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

Open
#14,970 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • [x ] Have you provided a full/minimal spec to reproduce the issue?
  • [ x] Have you validated the input using an OpenAPI validator (example)?
  • [x ] Have you tested with the latest master to confirm the issue still exists?
  • [ x] Have you searched for related issues/PRs?
  • [x ] What's the actual output vs expected output?
  • [ x] [Optional] Sponsorship to speed up the bug fix or feature request (example)
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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported failure with openapi-generator-maven-plugin 5.1.0 in a Java 8 project using Maven 3.9.0, then compare it with Maven 3.8.8 using mvn clean install. Obtain a shareable stack trace and trace the Null Pointer Exception to determine the compatibility issue; done means the build succeeds on the affected Maven version with suitable verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.