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

Unable to generate sources for multiple version of java #1255

Closed
sjmittal opened this issue May 3, 2021 · 2 comments
Closed

Unable to generate sources for multiple version of java #1255

sjmittal opened this issue May 3, 2021 · 2 comments

Comments

@sjmittal
Copy link

sjmittal commented May 3, 2021

I am using the jsonschema2pojo-maven-plugin to generate java sources via maven.
I have java version 11 installed on my PC but I need to generate the sources for both java8 and java11 versions.
I have tried configuring the targetVersion attribute in the plugin but it still seems to be generating the source for java 11. Basically it is picking up the java version of the installed JRE and not the targetVersion property.

So as next step when I try to compile the sources as java8 it fails.
The reason is because then import statements are generated as
import javax.annotation.processing.Generated; and not
import javax.annotation.Generated;

Any idea if this is an issue or how this can be worked around.

@joelittlejohn
Copy link
Owner

I think we can fix this, but I'm interested to know if you are able to try adding this dependency to your project:

https://search.maven.org/artifact/org.jsonschema2pojo/jsonschema2pojo-jdk-annotation/0.0.1/jar

In theory it includes only the annotation that you need, and is intended to be used when javax.annotation.processing.Generated is not available.

@joelittlejohn
Copy link
Owner

Closed by #1482.

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

No branches or pull requests

2 participants