I have a Java project which is a combination of human-written Java code and Java code generated by axis2.
The axis2 generated code provokes thousands of warnings from the Java compiler (either javac or the one built into Eclipse). Examples of warnings: dead code, use of raw list and array types predating Java generics, etc. (more at http://www.coderanch.com/t/501752/Web-Services/java/Axis-Generate-without-Warnings). I'd like to silence and ignore these specific warnings in the generated code, but not the human-written code.
I've seen How to add -Xlint:unchecked option or any javac option in Eclipse? and that allows me to disable the relevant warnings via Window->Preferences, but workspace-wide, which is not what I want. Is there a way to do this on a per-project basis?
If not, how do people deal with generated code without ignoring warnings that would be useful to humans?
You can enable lots of different options on a per-project basis. Assuming you're using Helios, here's how to configure warnings on a particular project:
The multiple projects approach suggested by Matt is the right solution (since you can remove all warnings for a given project)
To try to do so within the same project has been:
So far, there isn't a way to "ignore warnings from certain source folders".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With