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>
  • 相关阅读:
    装饰设计模式
    Enum的基本使用
    java根据文件流判断文件类型(后缀名)
    Java正则表达式的用法
    java遍历Map
    java操作json
    struts2+ajax+jquery
    Hibernate注解
    oracle经典建表语句--scott建表
    Struts2 ui标签
  • 原文地址:https://www.cnblogs.com/exmyth/p/5136333.html
Copyright © 2011-2022 走看看