I'm getting loads of warnings from generated files in my target
folder (e.g. Java code generated from XSDs or surefire reports) that I can't fix, and it's hiding proper warnings in my source code.
Does anyone know of a way to tell Eclipse not to display warnings in certain folders, or just the "Derived" or target folders?
I've only been able to find the following two "almost" solutions:
source
folder. But this obviously doesn't work for cases where the folders aren't source folders (like the surefire reports). It does however fix one specific problem with warnings about generated sources, but might not in others, where the sources aren't (can't be) included as source.It would just be nice if there was a way to tell eclipse not to display warnings about things in the target folder altogether, as it's often not very useful and might hide actual problems.
Cheers,
Svend.
Mark the "target" folders as "derived" resource from the properties screen of those folders (this option is next to read only and archive property). In the quick search ( Ctrl + Shift + R ) screen press the arrow in the top right corner and untick "Show derived resources".
For the Target Management Project, we recommend enabling the following compiler warnings in JDT (Window > Preferences > Java > Compiler > Errors/Warnings and Javadoc). Settings that differ from the JDT default are marked in bold.
Right-click the package you want to move, and select " Refactor/Rename..." -- NOT " Move "! Modify the name of the package to reflect its desired new position in the package hierarchy, e.g. Prepend any new parent package name(s) if you are moving the package to downwards in the package hierarchy.
It turns out you can do this fairly simply (at least in Eclipse Kepler).
Open up the Preferences panel, either for Eclipse as a whole or for the project. Select the Validation pane (if you're using the project preferences panel, you may need to enable project-specific settings). Now go to the validator that's causing you problems (in my case, it was the HTML validator, but it depends on what you're doing) and click the button to edit its settings, which pops up another dialog.
In this dialog you want to make sure that there is an Exclude Group that excludes Folder: target. If there's no exclude group at all, add one with the button on the right. Then select the exclude group and Add Rule… to bring up another dialog/wizard. You want to add a Folder or file name, and in the next step pick the target folder to exclude (using the Browse Folder… button) and keeping the checkbox for using just the simple filename checked. If you're adding a global rule, it doesn't matter which target
folder you pick.
The OK/Apply back out of all the dialogs to apply the change you've made (or maybe add more exclusion rules). You'll need a rebuild so that the rule change is applied correctly, but that's straight-forward.
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