34

I use a maven standard directory layout for my projects.

The image Below is a typical project explorer view of a "not so minimum working example" of the view I want to customize.

My typical project explorer view layout

As you can see, all the relevant folders are marked as source folders, so there is no need to show the src folder hierarchy as it is shown below the included libraries.

So the question is, how can I get rid of the redundant src folder showing, i.e. how to show only source folders and libraries?

I've playing around with filters and content configuration of the view but couldn't find the way to do it.

Lii
  • 11,553
  • 8
  • 64
  • 88
mamuso
  • 3,117
  • 3
  • 30
  • 32
  • 1
    I cannot post it, as an spam prevention policy, until I got 10 points. I will add it when I can. The image shows a "src" folder "twice" (not exactly), first as src/main/java and similar packages and then as a "src" (not source) folder with its hierarchy. – mamuso Jan 21 '13 at 11:11
  • 1
    While the response provided by @Andreas B. isn't a complete solution, it works well if you restrict yourself to the Java perspective – Vimbai Chatitai Jul 08 '18 at 18:35

3 Answers3

15

Click to the third right top button, then "Filters" and then check "Name filter patterns" and write "src". Then the second src folder is hidden.

Andreas B.
  • 166
  • 3
  • 5
    When you have other non-Maven projects in your workspace you can't see your src folders any more. Not a complete solution. – Duncan Calvert Jan 21 '15 at 00:38
  • This worked with me when I used package explorer instead of project explorer. I'm using Eclipse Java EE IDE Version: Photon Release (4.8.0) Build id: 20180619-1200 – Organic Advocate Aug 29 '18 at 16:19
3

This is actually not added twice it is because of the explorer view you are using, just change it to navigator view and your problem will get solved.

Check this post might help you more, it is not related to you answer but show how to select navigator view Hope this will help you :).

Community
  • 1
  • 1
NoNaMe
  • 6,020
  • 30
  • 82
  • 110
  • Nice one buuut... the navigator hasn't the content extensions (java elements, for example) which package or project explorer views have. – mamuso Jan 21 '13 at 11:29
  • In Juno, AFAIK, the navigator view has no "Customize view..." option in the dropdown config menu(package and project explorer views do have it), where you can choose extensions as the above mentioned "java elements", which allow things like the green java class icon up there in the image. – mamuso Jan 21 '13 at 11:38
  • Best of luck for further search :) – NoNaMe Jan 21 '13 at 11:50
3

The description in Andreas B.'s answer refers to the Package Explorer view. In Project Explorer view it's:

View MenuFilters and Customization...User filtersNewsrc → activate/check it → OK

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107