Adding Maven dependencies

The archetype that we selected for the project does not include some of the dependencies required for a JEE web project. Therefore, you might see error markers in index.jsp. We will fix this by adding dependencies for the JEE libraries:

  1. With pom.xml open in the editor, click on the Dependencies tab.
  2. Click the Add button. This opens the Select Dependency dialog.
  3. In the filter box, type javax.servlet (we want to use servlet APIs in the project).
  1. Select the latest version of the API and click the OK button.
Figure 2.32: Adding servlet API dependency

However, we need JAR files for servlet APIs only at the compile ...

Get Java EE 8 Development with Eclipse now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.