Cannot change version of project facet Dynamic Web Module to 3.1 (Eclipse Maven唯一解决方案)

If you want to use version 3.1 you need to use the following schema:

  • http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd

Note that 3.0 and 3.1 are different: in 3.1 there's no Sun mentioned, so simply changing 3_0.xsd to 3_1.xsd won't work





Also, make sure you're depending on the latest versions in your pom.xml. That is,


    org.apache.maven.plugins
    maven-war-plugin
    2.4
    
        ...
    

and


    javax.servlet
    javax.servlet-api
    3.1.0
    provided

Also, you should compile with Java 7 or 8:


    org.apache.maven.plugins
    maven-compiler-plugin
    3.1
    
        1.7
        1.7
    


2016-02-20
添加,如果还有错,按照下面配置进行修改
 

Another way is to edit the project facet configuration file itself: org.eclipse.wst.common.project.facet.core.xml

Change the dynamic web module version in this line to 3.0 - 

And then:

  1. Right-click on the project (in the Project Explorer panel).
  2. Select Maven » Update Project (or press Alt+F5)

You'll find this file in the .settings directory within the Eclipse project.

你可能感兴趣的:(Java)