zoukankan      html  css  js  c++  java
  • 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:

    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.

  • 相关阅读:
    springboot集成websocket
    验证regex表达式本身是否有问题
    Quartz Cron表达式 生成
    Cannot run program "python": CreateProcess error=2, 系统找不到指定的文件
    遇到多个构造器参数时,要考虑用构造器
    考虑使用静态工厂代替构造器
    idea自定义注释
    layui2.4.0前的table隐藏列
    002、获取屏幕大小
    001、关于TextView的一些小知识
  • 原文地址:https://www.cnblogs.com/tlnshuju/p/7088063.html
Copyright © 2011-2022 走看看