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

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

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

  1. <plugin>
  2. <groupId>org.apache.maven.plugins</groupId>
  3. <artifactId>maven-war-plugin</artifactId>
  4. <version>2.4</version>
  5. <configuration>
  6. ...
  7. </configuration>
  8. </plugin>

and

  1. <dependency>
  2. <groupId>javax.servlet</groupId>
  3. <artifactId>javax.servlet-api</artifactId>
  4. <version>3.1.0</version>
  5. <scope>provided</scope>
  6. </dependency>

Also, you should compile with Java 7 or 8:

  1. <plugin>
  2. <groupId>org.apache.maven.plugins</groupId>
  3. <artifactId>maven-compiler-plugin</artifactId>
  4. <version>3.1</version>
  5. <configuration>
  6. <source>1.7</source>
  7. <target>1.7</target>
  8. </configuration>
  9. </plugin>

  1. 2016-02-20
  1. 加入,假设还有错,依照以下配置进行改动
  1.  
  2. Another way is to edit the project facet configuration file itself: org.eclipse.wst.common.project.facet.core.xml
  3.  
  4. Change the dynamic web module version in this line to 3.0 - <installed facet="jst.web" version="2.5"/>
  5.  
  6. And then:
    1. Right-click on the project (in the Project Explorer panel).
    1. Select Maven » Update Project (or press Alt+F5)
  7.  
  8. 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. Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

    Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>' 点开错误的文 ...

  2. Java Servlet 非英文乱码

    response.setHeader("Content-Type", "text/json; charset=UTF-8"); request.setChara ...

  3. vue 中slot 的具体用法

    子组件 <template> <div class="slotcontent"> <ul> <!--<slot></sl ...

  4. Linux忘记root密码,密码找回,图片展示

    忘记root密码 CentOS 7参考地址如下:https://www.baidu.com/s?wd=CentOS7+%E6%89%BE%E5%9B%9Eroot%E5%AF%86%E7%A0%81& ...

  5. awk输出指定列

    awk '{print $0} file' #打印所有列awk '{print $1}' file #打印第一列 awk '{print $1, $3}' file #打印第一和第三列 cat fil ...

  6. CSS——可视化格式模型

    CSS的可视化格式模型 CSS中规定每一个元素都有自己的盒子模型(相当一规定了这个元素如何显示): 然后可视化格式模型则是把这些盒子模型按照规则摆放到页面上,也就是如何布局: 换句话说,盒子模型规定了 ...

  7. c#数据库连接学习

    /*通过C#winform程序访问数据库数据 用到的命名空间和变量类型: using System.Data.SqlClient; SqlConnection:数据库连接类 SqlCommand:数据 ...

  8. 对Spring框架的理解(转)

    ①  spring框架是一个开源而轻量级的框架,是一个IOC和AOP容器 ② spring的核心就是控制反转(IOC)和面向切面编程(AOP) ③  控制反转(IOC):是面向对象编程中的一种设计原则 ...

  9. BNUOJ 7697 Information Disturbing

    Information Disturbing Time Limit: 3000ms Memory Limit: 65536KB This problem will be judged on HDU. ...

  10. 如何把DEBIAN变成UBUNTU-DESKTOP最少化安装

    Ubuntu 18.04没有32位,老电脑要装32位下面方法可以实现 Debian 9.6变成Ubuntu-Desktop 最少化 1 安装Debian 9.6时用expert mode 安装,安装过 ...