Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Imports generation issue with raml-to-jaxrs maven plugin #320

Closed
amagnus opened this issue Nov 21, 2017 · 3 comments
Closed

Imports generation issue with raml-to-jaxrs maven plugin #320

amagnus opened this issue Nov 21, 2017 · 3 comments

Comments

@amagnus
Copy link
Contributor

amagnus commented Nov 21, 2017

Hello,

The issue is that the generated ResponseDelegate contains this:

import java.lang.Class;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.annotation.Annotation;

It should only contain this java.lang import:

import java.lang.annotation.Annotation;

This is causing a conflict with maven-checkstyle-plugin which is throwing errors when simple java.lang imports are present. So we end up having to manually edit ResponseDelegate where we shouldn't touch generated code.

I looked into it and found that there is a skipJavaLangImports flag on the javapoet library, which can be set here:
https://github.com/mulesoft-labs/raml-for-jax-rs/blob/master/raml-to-jaxrs/jaxrs-code-generator/src/main/java/org/raml/jaxrs/generator/ResponseSupport.java#L105

However it doesn't work when I try to set it to true.

Just my two cents, as we're trying to reduce friction around the maven plugin.

@jstoiko
Copy link
Contributor

jstoiko commented Nov 22, 2017

Seems like we're depending on an older version of javapoet. Maybe that option was introduced later on or not working as expected in that version? MY 2c :)

@amagnus
Copy link
Contributor Author

amagnus commented Nov 22, 2017

Tested the latest version with same result.

jpbelang added a commit that referenced this issue Jan 26, 2018
@jpbelang
Copy link
Contributor

Fixed on release/2.2.0

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

No branches or pull requests

3 participants