eclipse--maven--Cannot change version of project facet Dynamic web module to 3.0

场景:Project Facets中 Dynamic Wen Module--3.1,Java--1.8

异常:Cannot change version of project facet Dynamic web module to 3.0

原因:当前配置只支持Dynamic web module最大3.0

 

一、修改web.xml

  web-app_3_0.xsd---》web-app_3_1.xsd

  version="3.0"-->version="3.1"

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns
="http://java.sun.com/xml/ns/javaee"
     xsi:schemaLocation
="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd"
id
="WebApp_ID" version="3.1">

 

二、修改.settings目录下org.eclipse.wst.common.project.facet.core.xml

  目录:项目存放位置,文件夹默认隐藏的

    java-->version--1.8

    jst.web-->version--3.1

<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
  <fixed facet="wst.jsdt.web"/>
  <installed facet="java" version="1.8"/>
  <installed facet="wst.jsdt.web" version="1.0"/>
  <installed facet="jst.web" version="3.1"/>
  <installed facet="jst.jsf" version="2.2"/>
  <installed facet="jst.jaxrs" version="2.0"/>
</faceted-project>

 

三、pom.xml配置 org.apache.maven.plugin

  位置:如果有父子工程,建议在父工程下配置,可以覆盖所有子工程

<build>
      <plugins>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                  <source>1.8</source>
                  <target>1.8</target>
              </configuration>
          </plugin>
      </plugins>
  </build>

 

四、工程清理  

Project Clean
maven clean

 

posted @ 2017-01-12 13:53  刘广平  阅读(208)  评论(0)    收藏  举报