Search code examples
intellij-ideaintellij-14

Cannot add Servlet in a Maven Project


I'm testing IntelliJ with a Maven Project, it creates the Project fine, the problem is that I don't see the option to add a Servlet, and i don't see an option to add a package eather. just JSP and JSF pages, this is the sub-menu I get, how can I add a servlet and a package?

Anexed screenshot


Solution

  • This is because the folder on which you're invoking the context menu is not marked as a "source" folder.

    One way of marking it is to right-click on it (in your case the "java" folder) and choose "Mark Directory As > Sources Root".