After solving Maven update, Dynamic Web module becomes 2.3 error in the project

Create a Maven project with Eclipse, modify the web version to 3.1, modify the JDK to 1.8, and use the Ali mirror warehouse

The JDK is 1.8. After configuring the pom.xml file, as long as you click Maven - Update Project, there will be an error that Dynamic Web module becomes 2.3.

The solution is to find the web.xml under the webapp file in the project [Note: not the web.xml of the external project, but in the webapp folder in the project]

Replace 2.3 with 3.1


Save it after making changes, then click Maven - update Project and you're done! !

Finally, copy the web header information of 3.1 in to prevent errors

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://xmlns.jcp.org/xml/ns/javaee"
	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
	id="WebApp_ID" version="3.1">
  <display-name>Archetype Created Web Application</display-name>
</web-app>


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326051519&siteId=291194637