Cannot change version of project facet Dynamic Web Module to x.x

1. Problem

When you create maven web project it default using version servlet 2.3. Now you want change servlet 2.5 or 3.0. You come and manual change on web.xml as below

<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
          http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    version="3.0">
...

And now your project on eclipse alway has red mark and with problem show error:

Cannot change version of project facet Dynamic Web Module to 3.0.

2. Solution

Right click on project in eclipse project explorer, choose properties-> Project facets-> uncheck on Dynamic Web Module and click  Apply. Right click on project and choose maven-> update project the project will automatic update and resolve above issue.


Leave a Reply