src/main/webapp directory not recognized by Eclipse

Instead of adding /src/main/webapp as a source folder in the java build path, add it as a folder to include in the deployment assembly:

MyProject -> properties -> Deployment Assembly: Add "/src/main/webapp" deploys to "/"


  1. Is this a correct behavior ? (I was thinking it could be treated as other resources ...)
  2. Could I fix it?
  3. I wonder if there are other drawbacks for this situation, that I would not be aware of right now?
  1. Yes, to me this is the correct behavior.
  2. It doesn't really make sense for src/main/webapp to be a source folder, it doesn't contain compilable source files.
  3. I don't know. I guess it depends on your expectations :)

That said, m2eclipse made a contribution that allows to make src/main/webapp available at the top level with a specific "Web Resources" label, something like this:

alt text

This could be a solution for your concern (the not convenient folding).