1. 程式人生 > >解決maven項目Cannot change version of project facet Dynamic web module to 3.0/3.1

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

gin art sha fine con ava nco fin lips

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