How can I stop Eclipse warning about target folder's contents?

后端 未结 2 1858
走了就别回头了
走了就别回头了 2021-01-17 19:35

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 hi

相关标签:
2条回答
  • 2021-01-17 19:42

    Folders that are not source folders are not compiled by Eclipse. So you should not have Java error/warning for those.

    For source folder, you already have the solution ('Ignore optional compile problems' parameter).

    0 讨论(0)
  • 2021-01-17 19:44

    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.

    0 讨论(0)
提交回复
热议问题