Cannot change version of project facet Dynamic Web Module to 2.5

short version

Try this:

  • Deselect the Dynamic Web Module in your project facets.
    Right click the Project -> preferences -> Project Facets
  • Then run Maven -> Update Project again.

Long Version

I’ve had this problem a number of times while learning some eclipse dynamic web/spring stuff and none of the other solutions fixed my issue reliably or helped me understand what was causing the issue. I think I am beginning to.

So it appears that when you run a Maven -> Update Project, m2e (I assume) is ADDING the Dynamic Web Module to the Project Facets. Adding is the key word here. So when I went in and updated web.xml
from
[…] http://java.sun.com/xml/ns/javaee/web-app_2_3.xsd” version=”2.3″>
to
[…] http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd” version=”2.5″>

I got the error “Cannot change version of project facet Dynamic Web Module to 2.5.”

Same was true for 3.0 when I tried that.

It appears m2e is capable of adding this to your project but like the error says it is unable to change it once it is set. So simply deselect it in the project facets page. Hit O.K. to save your preferences and run Maven Update again.

Eclipse Project Facets Dynamic Web Module

You shouldn’t need to include javax.servlet in your pom.xml if you have a server (like tomcat) facet added.

Servlet-Api included in libraries

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)