Search code examples
eclipsemavenm2eclipsem2eeclipse-wtp

How to avoid three clicks to get into src/main/webapp in eclipse?


I am setting up a maven web app project in eclipse, maven likes to put the webapp resources in src/main/webapp which is a pain to navigate to because I have to click three times to get to webapp contents.

  • click 1 expand src
  • click 2 expand main
  • click 3 expand webapp

Example of three levels of clicks needed to navigate to webapp

In a typical WTP eclipse project there is only WebContent and is a top level folder so only one click is needed to get into it.

Is there an eclipse or m2e trick to make the webapp show up as a top level element under the project.


Solution

  • Right click the webapp folder and select Build Path -> Use as Source Folder. The folder will be presented on top (in a hierarchical package presentation). It should have no side effects to the final war.

    enter image description here