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

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

<?

xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee"> </web-app>

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

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
...
</configuration>
</plugin>

and

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

Also, you should compile with Java 7 or 8:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>

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 - <installed facet="jst.web" version="2.5"/>

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.

Cannot change version of project facet Dynamic Web Module to 3.1 (Eclipse Maven唯一解决方式)的更多相关文章

  1. eclipse 创建Java web项目 Cannot change version of project facet Dynamic web module to xxx

    问题描述: 用Eclipse创建Java web项目时选择的Artifact Id为maven-artchetype-webapp,由于这个archetype比较老,用的servlet还是2.3的. ...

  2. MAVEN解决Cannot change version of project facet Dynamic web module to 2.5

    我们用Eclipse创建Maven结构的web项目的时候选择了Artifact Id为maven-artchetype-webapp,由于这个catalog比较老,用的servlet还是2.3的,而一 ...

  3. 解决Cannot change version of project facet Dynamic web module to 2.5

    我们用Eclipse创建Maven结构的web项目的时候选择了Artifact Id为maven-artchetype-webapp,由于这个catalog比较老,用的servlet还是2.3的,而一 ...

  4. eclipse 导入新项目后报错:Cannot change version of project facet Dynamic web module to 2.5

    错误原因: 我们用Eclipse创建Maven结构的web项目的时候选择了Artifact Id为maven-artchetype-webapp,由于这个catalog比较老,用的servlet还是2 ...

  5. 解决Cannot change version of project facet Dynamic web module to 3.0

    我们用Eclipse创建Maven结构的web项目的时候选择了Artifact Id为maven-artchetype-webapp,由于这个catalog比较老,用的servlet还是2.3的,而一 ...

  6. 【转】解决Cannot change version of project facet Dynamic web module to 2.5

    http://blog.csdn.net/steveguoshao/article/details/38414145 我们用Eclipse创建Maven结构的web项目的时候选择了Artifact I ...

  7. Maven导入时,Cannot change version of project facet Dynamic Web Module to 3.0.

    今天手贱,在eclipse里面把项目删掉了,重新maven导入时,报出Cannot change version of project facet Dynamic Web Module to 3.0. ...

  8. eclipse中Cannot change version of project facet Dynamic Web Module to 2.5.

    Cannot change version of project facet Dynamic Web Module to 2.5.这个错误可能很多人都碰到过,这里网上查了一些资料,解决的问题.所以这里 ...

  9. 解决maven项目Cannot change version of project facet Dynamic web module to 3.0

    问题描述         用Eclipse创建Maven结构的web项目的时候选择了Artifact Id为maven-artchetype-webapp,由于这个catalog比较老,用的servl ...

  10. ERROR: Cannot change version of project facet Dynamic Web Module to 3.0?

    Issue: When you create web app in eclipse with maven configuration, you may get following error. Can ...

随机推荐

  1. java实现搜索文件夹中所有文件包含的关键字的文件路径(递归搜索)

    import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io ...

  2. CentOS 初体验十四:阿里云安装Gitlab

    网址:https://about.gitlab.com/install/#centos-7 https://blog.csdn.net/zhaoyanjun6/article/details/7914 ...

  3. BZOJ3545 Peaks 离线处理+线段树合并

    题意: 在Bytemountains有N座山峰,每座山峰有他的高度h_i.有些山峰之间有双向道路相连,共M条路径,每条路径有一个困难值,这个值越大表示越难走,现在有Q组询问,每组询问询问从点v开始只经 ...

  4. 树莓派-3 启用root

    默认是user: pi,  password: raspberry 通过如下设置root密码并启用 pi@raspberrypi:~ $ sudo passwd root Enter new UNIX ...

  5. 常用的四种设计模式 PHP代码

    // 工厂模式 interface Iuser { public function getUserName(); } class UserFactory { static public functio ...

  6. Notepad++ 连接远程 FTP 进行文件编辑

    一.下载安装 Notepad++ 1.下载 Notepad++ : https://pan.baidu.com/s/1o7VrS4y 密码 : ck8a 2.安装 Notepad++ 2.1.勾选所有 ...

  7. 自动生成 serialVersionUID 的设置

    1 把鼠标放在类名上,会出现小灯泡的形状 点击 Add ‘serialVersionUID’ field... 即可生成 如果鼠标放在类名上没有出现 Add ‘serialVersionUID’ fi ...

  8. hdu 3697 贪心

    #include<stdio.h> #include<stdlib.h> #include<string.h> #define inf 0x3fffffff #de ...

  9. codeforces 363B

    #include<stdio.h> #include<string.h> #define inf 999999999 #define N 151000 int a[N],c[N ...

  10. [NOIP2006] 普及组

    明明的随机数 STL真是偷懒神器 /*by SilverN*/ #include<algorithm> #include<iostream> #include<cstri ...