Avoiding Compiler warnings on code generated by xjc
Asked Answered
C

0

4

My root question is how to benefit from the 'unchecked generics type' Eclipse compiler warning, but not have the list of those warnings in the Problems view polluted by noise from java classes which are generated from xsd files by xjc (via maven-jaxb2-plugin.)

I've read other places that I can ignore compiler warnings per source folder and that would be great, but I don't have the authority to place the generated code it it's own source folder. :(

Given my situation, my assumption is that the easiest and most durable way to do this would be to use jaxb binding files (.xjb) to add @SuppressWarnings at the class level of all of the classes that jaxb generates. However I'm not very smart on using xjc, I just see how it/maven/eclipse are wired together to generate .java files from the .xsd files. So this leads to 2 questions. First, am I wrong to think this possible/easy? Second, if that is easy what's a good way at getting started on accomplishing this?

Cranach answered 11/11, 2013 at 22:30 Comment(1)
possible duplicate of Suppress compiler warnings on JAXB generated classesVelocipede

© 2022 - 2024 — McMap. All rights reserved.