Eclipse Maven显示同一个文件的多个路径 [英] Eclipse Maven showing multiple paths for the same file
问题描述
Eclipse中是否有任何设置仅显示文件所在的Maven项目?
Is there any setting in Eclipse to show only the Maven project where the file resides?
我有不同的Maven项目是父Maven项目的模块:
I have different Maven projects which are modules of a parent Maven project:
projParent
|-projWeb
|-projModel
|-projServices
|-...
如果我在Eclipse中使用Open Resource(使用 Ctrl + Shift + r
)查找文件,在许多项目中(例如:projParent和projWeb)。
If I look for a file using "Open Resource" (using Ctrl + Shift + r
) in Eclipse, it appears in many projects (E.g.: in projParent and in projWeb).
有没有办法只显示该文件实际居住的相关文件夹?
Is there any way to show only relevant folder where that file is actually resided in?
推荐答案
尝试定义一个工作集,其中只包含要搜索的模块,然后在搜索中使用该工作集。
Try defining a Working Set that includes only the modules in which you want to search and then use that Working Set in the search.
编辑
实际上我尝试过,只是在eclipse中默认完美地运行4.3(开普勒),只有一个结果是retu嵌套项目。
Actually I tried it and it just works perfectly by default in eclipse 4.3 (Kepler), only one result is returned for nested projects.
无论如何,在开放资源中使用工作集(该示例不是嵌套模块中的资源,因为在这种情况下,开普勒不会显示重复的结果;所以这个例子只是两个不同的资源,在两个不同的模块中相同的名字):
Anyway, here's how to use working set in open resource (the example is not of a resource in a nested module as in this case Kepler don't show duplicate results; so the example is just of two different resources baring the same name in two different modules):
(1)点击 ctrl + shift + R 键。我搜索了一个名为 pom.xml
的资源。你可以看到两个结果:
(1) Hit the ctrl+shift+R keys. I searched for a resource called pom.xml
. You can see two results:
(2)按下窗口右上角的向下指向的小箭头,然后选择选择工作集...
:
(2) Press the little downward-pointing arrow on the top right of the window and choose Select Working Set...
:
(3)检查所选工作集
的单选按钮,并检查所需的项目(在您的情况下叶子项目):
(3) Check the radio button of Selected Working Sets
and check the desired projects (in your case the leaf projects):
(4)瞧,开放资源
只返回一个结果:
(4) And voila, Open Resource
returns only one result:
这篇关于Eclipse Maven显示同一个文件的多个路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!