首页 > 技术文章 > 解决maven项目Cannot change version of project facet Dynamic web module to 3.0/3.1

achengmu 2018-05-28 18:38 原文

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

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> 

  

推荐阅读