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

Posted 穆晟铭

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决maven项目Cannot change version of project facet Dynamic web module to 3.0/3.1相关的知识,希望对你有一定的参考价值。

1.打开项目所在目录下的.settings文件夹

打开org.eclipse.wst.common.project.facet.core.xml

把<installed facet="java" version="1.5"/>改成<installed facet="java" version="1.8"/>,把  <installed facet="jst.web" version="2.3"/>改成  <installed facet="jst.web" version="3.0"/>

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

  

2.在pom.xml中增加

<!-- define the project compile level -->  
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>          
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin> 

  

以上是关于解决maven项目Cannot change version of project facet Dynamic web module to 3.0/3.1的主要内容,如果未能解决你的问题,请参考以下文章