Cannot change version of project facet Dynamic Web Module to 2.5

I've inherited a Java web app from another company. I'm trying to load it into Eclipse (via Import Maven Project), and getting an error that says "Cannot change version of project facet Dynamic Web Module to 2.5".

I've been poking around a little, and one thing I'm finding is that the web.xml file starts with

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

and the pom.xml specifies a dependency of

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>

but the .settings folder contains a file with this

<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
  <fixed facet="wst.jsdt.web"/>
  <installed facet="java" version="1.6"/>
  <installed facet="jst.web" version="3.0"/>
  <installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>

and I suspect that the 3.0 specified here is conflicting with the 2.5 specified elsewhere. Is that likely to be the case? Is there any way this combination of settings could NOT result in errors? (Older version of Eclipse, eg?)

Cannot change version of project facet Dynamic Web Module to 3.0 , The JSF version is currently set to 1.1 in Project Facets. When trying to change it to 2.0, the error is displayed “Cannot change version of project  Change the number from 3.0 to 2.5. Thats it 🙂 Your project facet will be changed. Thats it 🙂 Your project facet will be changed. Do let me know your thoughts or if you have any other achieving it let me know.

See Cannot change version of project facet Dynamic Web Module to 3.0?

Close the project, and directly update file 'org.eclipse.wst.common.project.facet.core.xml' located in the .settings folder of the project.

Change version of project facet Dynamic Web Module to 2.5 , Cannot change version of project facet Dynamic Web Module to 3.0. One or more constraints have not been satisfied  Change the dynamic web module version in this line to 2.5 – <installed facet=”jst.web” version=”2.4″/> Change the JSF version in this line to 2.0 – <installed facet=”jst.jsf” version=”1.1″/> Change the Java version in this line to 1.5 or higher – <installed facet=”java” version=”1.5″/>.

My guess is the original authors manually changed the Project Facets of the Eclipse project after the initial import and never ran Maven | Update after that.

Anyway, for Maven projects, it's good practice not to commit any Eclipse metadata (i.e. .classpath, .project, .settings/) to SCM and to let m2e generate them on import.

So I'd recommend to copy your project structure, delete all Eclipse metadata from the copy and then import via m2e.

If there are still any errors on import, than at least you might get a hint where the original authors tweaked the defaults, so you'll know where to start cleaning up.

How to Fix Cannot Change Version of Project Facet Dynamic Web , You will see “Cannot change version of project facet Dynamic Web Module to 3.0​. One or more constraints have not been satisfied” error while  I tried all the solution provided by stackflow for the this issue however I am facing same issue. I tried changing the facet to 3.0 but still the problem is same Can any one help me out in this ple

Open the Navigator view (Window > Show View > Other > General) and find that there is a .settings folder under your project, expand it and then open the file "org.eclipse.wst.common.project.facet.core.xml", make the below changes and save the file.

Change the dynamic web module version in this line to 2.5 – <installed facet="jst.web" version="2.4″/>

Change the JSF version in this line to 2.0 – <installed facet="jst.jsf" version="1.1″/>

Change the Java version in this line to 1.5 or higher – <installed facet="java" version="1.5″/>.

After this changes you can change the version of Project facet Dynamic Web Module from the project properties; without giving you this warrning

Cannot change version of project facet Dynamic Web Module to 2 5, How to fix Cannot change version of project facet Dynamic Web Module to 3.1 Error in Eclipse. 5 simple steps. In order to fix this first thing I did is to change Project Facets settings. Right click on Project in Eclipse Click on Properties Click on Project Facets Tab Change value from 3.1 to 3.0 for Dynamic Web Module as mentioned in below image.

In my case I wanted to change dynamic facet form 2.3 to 3.1.

What help me was one number change in may web.xml

From :

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app  > 
  <display-name>Archetype Created Web Application</display-name>
</web-app>

TO :

<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_5.dtd" >

<web-app  > 
  <display-name>Archetype Created Web Application</display-name>
</web-app>

And then go to properties -> Project Facets -> Uncheck the Dynamic Web Module -> OK

Updated Maven project.

Cannot change version of project facet Dynamic Web Module to 2.5. Cannot change version of project facet Dynamic Web Module to 2 5. Solution  When I tried to change the Projects Facet Dynamic Web Module something went wrong. I had change the Java to 1.7 in the same place. And it still told me, cannot change version of project facet Dynamic Web Module to 3.0. I have changed everything that would effect the changing I think. java eclipse maven. Share a link to this question.

4. Re: Cannot create a Dynamic Web Module 2.5 version project Max Rydahl Andersen Nov 18, 2008 2:43 AM (in response to null null) we listen to the WTP JSF facet being installed but we don't depend on it. Thus you don't have too enabled facets but we do support it that way.

Comments
  • Possible duplicate of Cannot change version of project facet Dynamic Web Module to 3.0?
  • Thanks. I had this problem upgrading JSF from 2.0 to 2.2. Had to remove first the JSF, then the Dynamic Web Module facet. Changed the <faces-config version="..."> also. (The JSF spec uses version="2.0" in the 2.2 release. Very confusing.)
  • Thanks, it helped me
  • Thanks, this was very helpful and trivially easy.
  • This was a new one for me. Thanks for posting!
  • I used to fix this by searching through all my eclipse config files and replacing 2.3 with 2.5. It worked about 50% of the time, this is much better
  • Yes, it works, but you don't need to close the project. Just press Ctrl + Shift + R in Eclipse, open org.eclipse.wst.common.project.facet.core.xml and update the line <installed facet="jst.web" version="2.3"/> with the new version.
  • removing the .classpath, .project, .settings helped me to customize project facets.
  • Removing the project from eclipse and mentioned files then importing back the project as a maven project worked for me here! Thanks.
  • but what if you need 2.5 not 3.0 ?
  • Looks like having some dependencies affects servlet version. Spring Boot in particular.
  • P.P.S. Excluding embedded tomcat (spring-boot-starter-tomcat) fixed the issue it seems.