Eclipse Maven showing multiple paths for the same file

拥有回忆 提交于 2019-11-29 01:57:24

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.

EDIT

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) Hit the ctrl+shift+R keys. I searched for a resource called pom.xml. You can see two results:

(2) Press the little downward-pointing arrow on the top right of the window and choose Select Working Set...:

(3) Check the radio button of Selected Working Sets and check the desired projects (in your case the leaf projects):

(4) And voila, Open Resource returns only one result:

You are probably talking about a kind of duplication between parent project and its sub-modules. In the latest version of Eclipse (from 3.6 maybe and sure from 3.7) there is a new option

Menu Windows >

Item Preferences >

    Tree item Maven >

       Option : Hide folders of physically nested modules

This would not work on a existing project. You must delete them (logically) and re-import them

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!