Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Generated annotation generator ignores target Java version #1361

Closed
eirnym opened this issue Dec 23, 2021 · 4 comments · Fixed by #1482
Closed

@Generated annotation generator ignores target Java version #1361

eirnym opened this issue Dec 23, 2021 · 4 comments · Fixed by #1482

Comments

@eirnym
Copy link

eirnym commented Dec 23, 2021

When use jsonschema2pojo generator with runtime java version 9+ it's impossible to generate classes for older versions of java, even target version is set to 1.7 or 1.8.

It's quite unfortunate for our project (which uses java 11+) to use detached module only to publish models compatible with java 1.8

Both maven and gradle generators are affected.

@jrevillard
Copy link

Same issue here indeed

@unkish
Copy link
Collaborator

unkish commented Jun 22, 2022

It seems that this was a deliberate decision, see:

Reversing that decision would mean introducing "breaking change" (for users relying on current implementation without having targetVersion overridden) as default targetVersion is 1.6 (ref).
On the other other hand honoring targetVersion would make outcome predictable and correct.

@XN137
Copy link

XN137 commented Oct 28, 2022

same issue here since we are building on java 11 but target java 8
i'd agree that targetVersion should be considered when deciding which @Generated annotation to use

i could potentially provide a PR if there is agreement on the suggestion

@drekbour
Copy link

+1 targetVersion is an explicit command from the developer to ignore the runtime and "do what I say not what I do"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants