Eclipse文件搜索多次找到相同的文件 [英] Eclipse file search finds the same file multiple times

查看:544
本文介绍了Eclipse文件搜索多次找到相同的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Eclipse中,我有两个maven项目A和B,其中A是B的父项。目录结构如下:

In Eclipse I have two maven projects A and B, where A is a parent for B. The directory structure is the following:

A/pom.xml
A/B/pom.xml
A/B/...

然后我使用文件搜索(Ctrl + H)查找项目B中的任何文件。搜索结果窗口显示文件两次,具有不同的相对路径:

Then I use File search (Ctrl+H) to find any file in the project B. The search result window shows the file two times with different relative paths:

A/B/<my_file>
B/<my_file>

所以,同一个文件显示两次。显然,第一个搜索结果很简单。有没有办法排除这些重复的搜索结果?

So, the same file is shown twice. Obviously, the first search result is reduntant. Is there a way to exclude these duplicate search results?

推荐答案

我个人做的是避免这是标记父母中的每个模块项目作为导出(右键单击文件夹>属性>属性:派生)。

What I personally do to avoid this is marking each module in the parent project as derived (right-click on the folder > properties > Attributes: Derived).

然后执行文件搜索时,取消选中考虑派生资源(我不认为默认情况下检查),您将无法获取 A / B /< my_file>

Then when you perform a file search, uncheck "Consider derived resources" (I don't think it is checked by default) and you won't get the A/B/<my_file>.

唯一的不便之处在于,您必须为每个模块执行此操作,并且每次添加新模块时。

The only inconvenience is that you must do this for each module, and each time a new module is added.

这篇关于Eclipse文件搜索多次找到相同的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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