The problem that the dynamic web module version of the maven project generated by eclipse cannot support 3.X

 

Problem Description:

   eclipse mars, Maven3.3.9, Maven web project generated by wizard. When configuring the project feature project facets, the dynamic web module option (essentially the javaEE version or servlet version that the current eclipse can support) can always only support 2.3. After manually changing it to 3.0, an error will be reported and it will not be saved. Looking at the servlet configuration in the POM, it does refer to the JAR package of servlet 3.0, the version of web.xml is also 3.0, and the JDK configuration is also normal, but this item cannot be changed.

 



 

 

solution:

  There is a configuration file in eclipse called org.eclipse.wst.common.project.facet.core.xml responsible for persistent configuration of project features. It is invisible in the package explorer view, switch to the navigator view, and can be found in the .settings folder (or in the eclipse installation directory in windows). Modify the version attribute of the jst.web element to 3.0. After saving and closing, check the Project facets configuration, and find that it has been automatically switched to 3.0. You can use the new features of servlet 3.0 in eclipse, such as configuring servlets using annotations.

 



 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326582177&siteId=291194637