简体   繁体   English

在Eclipse Package Explorer中隐藏Maven项目

[英]Hide Maven projects in Eclipse Package Explorer

When I import a project into Eclipse using "Existing Maven Project" I can see the Maven project and all sub-projects in the Package Explorer like this: 当我使用“现有Maven项目”将项目导入Eclipse时,可以在Package Explorer中看到Maven项目和所有子项目,如下所示:

Eclipse屏幕截图

The project has a structure like this: 该项目具有如下结构:

karaf-tutorial-cxf\
    \personservice-parent
       \psersonservice-proxy
       \psersonservice-server
       \psersonservice-webui 
        ...

Two questions: 两个问题:

(1) Is it possible automatically hide Maven projects in the Package Explorer and only show Java projects? (1)是否可以在Package Explorer中自动隐藏Maven项目并仅显示Java项目? (in my example hide karaf-tutorial-cxf and personservice-parent) (在我的示例中,隐藏karaf-tutorial-cxf和personservice-parent)

(2) When I do a text search using "File / Search / Workspace" I get multiple hits for the same source file. (2)当我使用“文件/搜索/工作区”进行文本搜索时,同一源文件得到了多次匹配。 One for the Java file, one from it's Maven parent (personservice-parent) and one from the parents parent (karaf-tutorial-cxf). 一个用于Java文件,一个来自Maven父级(personservice-parent),另一个来自父级父级(karaf-tutorial-cxf)。 Is it possible to only show one hit (the one from the Java file)? 是否可能只显示一击(Java文件中的一击)?

First answer, 第一个答案,

Hide folders from nested maven project option is available as experimental feature in eclipse. 从嵌套的Maven项目中隐藏文件夹选项可作为Eclipse中的实验功能使用。 It is available while importing maven project. 导入Maven项目时可用。 Please see this option for more details 请查看选项以获取更多详细信息

Second answer 第二个答案

you can use open type CTRL+T for opening correct java file. 您可以使用打开类型CTRL+T打开正确的Java文件。 it will now show you multiple files from different sources. 现在它将向您显示来自不同来源的多个文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM