如何停止Eclipse关于目标文件夹内容的警告? [英] How can I stop Eclipse warning about target folder's contents?

查看:445
本文介绍了如何停止Eclipse关于目标文件夹内容的警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的目标文件夹(例如从XSD或肯定报告生成的Java代码)中,我收到的生成文件的加载警告,我无法修复,它是在我的源代码中隐藏适当的警告。

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.

有谁知道一种方法来告诉Eclipse不要在某些文件夹中显示警告,还是只显示派生或目标文件夹?

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:


  1. 问题视图中的过滤器允许您在描述中隐藏包含(或不包含)特定字符串的警告,但不包括其路径或资源(文件)的一部分。即使可以这样做,这不是一个理想的解决方案,因为警告仍将显示在包资源管理器中的项目中,隐藏潜在的真实警告。

  2. 使用最新的Eclipse版本Juno / 4.2)在Source选项卡下的Java Build Path设置中,可以从每个 source 文件夹中忽略可选编译问题。但这显然不适用于文件夹不是源文件夹的情况(如surefire报告)。 然而修正了一个具体的问题,关于生成的源的警告,但可能不在其他源,不包含源(不能)作为源。

  1. The filter in the "Problems" view allows you to hide warnings containing (or not containing) a specific String in their description, but not part of their path or resource (file). Even if you could, this wouldn't be an ideal solution as the warnings would still be displayed on the project in the package explorer, hiding potential real warnings.
  2. With the latest Eclipse version (Juno / 4.2) in the "Java Build Path" settings under the "Source" tab, you can "ignore optional compile problems" from each 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.

如果有一种方法告诉eclipse不会在目标文件夹中显示关于事件的警告,那么这将是很好的,因为它通常不是很有用,可能隐藏实际问题。

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.

干杯,

     Svend。

Cheers,
    Svend.

推荐答案

原来你可以简单地执行 (至少在Eclipse Kepler中) 。

It turns out you can do this fairly simply (at least in Eclipse Kepler).

打开首选项面板,无论是整个Eclipse还是用于项目。选择验证窗格(如果您使用项目首选项面板,则可能需要启用项目特定设置)。现在去验证器,导致你的问题(在我的情况下,这是HTML验证器,但它取决于你在做什么),然后单击按钮来编辑它的设置,弹出另一个对话框。

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.

OK /应用所有对话框以应用您所做的更改(或者可能添加更多排除规则)。您需要重建,以便正确应用规则更改,但这是直接的。

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.

这篇关于如何停止Eclipse关于目标文件夹内容的警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆