Java 从 Eclipse 中的验证中排除目录和子目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6495378/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-16 06:23:59  来源:igfitidea点击:

Exclude directories & subdirectories from validation in Eclipse

javaeclipsevalidation

提问by Ayyoudy

How do I exclude a folder AND its sub-directories from validation in eclipse? I know that you can right click on a folder in Package Explorer and select Exclude Validation, but if you have sub-directories under it, you'd have to this for each and it isn't ideal for generated directories or ones with many sub-folders.

如何从eclipse中的验证中排除文件夹及其子目录?我知道您可以右键单击包资源管理器中的文件夹并选择排除验证,但是如果您在其下有子目录,则您必须为每个子目录都这样做,这对于生成的目录或具有许多子目录的目录来说并不理想- 文件夹。

Any plug-ins that might be able to do this?

有什么插件可以做到这一点?

采纳答案by Sarah Haskins

I usually exclude validation in this way, I believe it will be recursive.

我通常以这种方式排除验证,我相信它会是递归的。

  • Right-click on your project and select Properties.
  • Choose Validation from the left-nav menu.
  • If it is not already selected choose "Enable project specific settings".
  • Find the validator that is relevant for what you want to exclude and click the "..." in the Settings column.
  • Highlight the Exclude Group and click Add Rule. (If you don't have any existing exclusions you may have to add an Exclude Group.)
  • Select Folder or file name as the Filter Type.
  • Click Next.
  • Select Browse Folder and find the folder you want to exclude.
  • 右键单击您的项目并选择属性。
  • 从左侧导航菜单中选择验证。
  • 如果尚未选择,请选择“启用项目特定设置”。
  • 找到与您要排除的内容相关的验证器,然后单击“设置”列中的“...”。
  • 突出显示排除组并单击添加规则。(如果您没有任何现有的排除项,则可能需要添加一个排除组。)
  • 选择文件夹或文件名作为过滤器类型。
  • 点击下一步。
  • 选择浏览文件夹并找到要排除的文件夹。

回答by Daniel B. Chapman

I'm running Helios SR 1 right now so hopefully this works...

我现在正在运行 Helios SR 1,所以希望这有效......

  • Select the Project
    • Right Click
    • Properties
    • Validation Menu -> Enable Project Specific Settings
    • Select the validator in question
    • Select/Deselect the validation for build/manual (or, if it something like the web tools you can configure specific rules by plugin--such as excluding a folder)
  • 选择项目
    • 右键点击
    • 特性
    • 验证菜单 -> 启用项目特定设置
    • 选择有问题的验证器
    • 选择/取消选择构建/手动验证(或者,如果它类似于 Web 工具,您可以通过插件配置特定规则——例如排除文件夹)

Hope that helps, it is by tool.

希望有帮助,这是通过工具。

回答by jobesu

I think the best way is:

我认为最好的方法是:

  • Right click the project
  • Properties
  • Java Build Path
  • "Source" tab
  • Select the folder that contains the file you want to exclude
  • Click the button "Edit..."
  • Next button
  • In the "Exclude patterns" Click "Add..." button
  • Add your filter
  • 右键单击项目
  • 特性
  • Java 构建路径
  • “来源”选项卡
  • 选择包含要排除的文件的文件夹
  • 单击“编辑...”按钮
  • 下一步按钮
  • 在“排除模式”中单击“添加...”按钮
  • 添加过滤器

The filter can be a single file or multiple files.

过滤器可以是单个文件或多个文件。

回答by yyc1217

For those PHP developers who coding in Eclipse Mars.

对于那些在 Eclipse Mars 中编码的 PHP 开发人员。

  1. Right click on folder.
  2. choose "Use As Library Folder"
  1. 右键单击文件夹。
  2. 选择“用作库文件夹”

For example in laravel framwork, you can exclude /vendor, /storageand /node_modulesfolders from eclipse validation.

例如,在 laravel 框架中,您可以从 eclipse 验证中排除/vendor/storage/node_modules文件夹。