I created a webapp using the maven simple webapp archetype, and then added the following dependency:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
I also changed the web.xml
file to use version 3.1:
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
I changed the java compiler version to 1.8. Eclipse now complains:
Cannot change version of project facet Dynamic Web Module to 3.1.
One or more constraints have not been satisfied.
Any idea how to remove this error?