11

I have a huge Maven multi-module project. With similar structure

parentA
  - subA1
     - subA3
     - subA3
  - subA2

parentB
  - subB1
  - subB2

etc

The problem is, that parentA and subA1 does not contains any code inside it, but I can still see them in project explorer. But I would like to hide them or organize in tree hierarchy like in an explorer. Right now there are over 30 projects and just 20 of them contains Java code. Others simply contains others modules references. I see all 30 projects in plain form in project explorer.

The first idea - was using working set, but I can't include working set in another working set. What is the common practice to handle this issue for eclipse users

user12384512
  • 3,362
  • 10
  • 61
  • 97
  • You could close that sub project simply – jmj Jun 07 '12 at 09:17
  • 1
    I'm not going to close sub-project. I should keep them open. I'm going to represent this structure in tree hierarchy, the problem is in parent project that are empty (only reference sub. projects) – user12384512 Jun 07 '12 at 09:20
  • 1
    I would like to know the same thing, and I assumed this was a common feature request...? Showing nested modules as a tree structure within one project – Alex Averbuch Feb 23 '13 at 13:22
  • I partially solved it using Eclipse Working Sets. Of course it does not display in tree hierarchy. At least I can hide some of Working Sets. Otherwise consider moving to Idea – user12384512 Mar 02 '13 at 19:20
  • 1
    This is a an annoying issue in eclipse when working on projects with a bunch of nested sub-modules. Not only it does crowd the project view, but it makes each and every function such as (Ctrl+H, file search, Ctrl+R, Ctrl+T) all bring up files from parent path as well as child path (which happens to the same file) - very annoying and counter productive. – ring bearer Sep 21 '16 at 06:13

6 Answers6

9

go: Windows -> Preferences -> Maven -> Hide folders of physically nested modules

and re-import your project.

Mindaugas K.
  • 433
  • 5
  • 12
5

We can also use working sets.

  1. Choose Top level Elements as 'Working Sets' from Package Explorer / Project Explorer view.
  2. Configure "Working Sets" to manage your projects. Move the Parent project to a different working set and child project in different working sets.
Kumar Sambhav
  • 7,503
  • 15
  • 63
  • 86
  • i went for this one and it worked perfectly fine for me as in my version of eclipse option of '`Hide folders of physically nested modules`' is annotated as `experimental`. – Alok Mishra Jul 24 '17 at 10:02
2

In Project Explorer, there's a down arrow, if you hover over it, it shows "View Menu".

Click on it, Project Presentation -> Hierarchical

Zwakele Mgabhi
  • 377
  • 2
  • 8
1

Try using Projects View. It does it for me in these kind of situations.

Also, you can put filters to exclude certain projects in Package Explorer or other views that you prefer like this: go to PackageExplorer, select View Menu - Filters, check Name filter Patterns and enter the names of the projects you want to hide, separated by commas.

In other views, instead of View Menu - Filters is View Menu - Customize View.

You can find a tutorial here but instead selecting Closed Projects enter the name of the projects as I mentioned above.

As for the tree view I don't think you achieve that because in Eclipse there is no notion of sub-project. Have a look here.

Community
  • 1
  • 1
tibtof
  • 7,857
  • 1
  • 32
  • 49
1

From the Package Explorer view select filter from 'view menu'. Then select filters, and exclude Non-java projects.

Praveen
  • 11
  • 1
0

On the package explorer window: -> Select the three dots menu -> Then Package Presentation -> And then change from Flat to "Hierarchical"

And you are done :D

Change project view image

augusticor
  • 86
  • 1
  • 5