Adding servlet support to the Maven webapp archetype

Today I wanted to create a servlet and used the m2eclipse plugin for Eclipse to create a web application based on the available Maven webapp archetype.

When using the archetype you will miss some essential jars and cannot create a Java 5 servlet. So I did the following:

1. adjust the pom: add dependency


2. adjust the web.xml: adjust the header

<?xml version=”1.0″ encoding=”UTF-8″?> 
<web-app xmlns=”” 
         xmlns:xsi=””        xsi:schemaLocation=”” 

3. open the properties of the project and under Java Compiler change the compliance level to 1.5

Leave a Reply

Your email address will not be published. Required fields are marked *