maven 构建项目时出错 “Dynamic Web Module 3.1 requires Java 1.7 or newer” in Eclipse

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了maven 构建项目时出错 “Dynamic Web Module 3.1 requires Java 1.7 or newer” in Eclipse相关的知识,希望对你有一定的参考价值。

记录一下,水平太菜,花费了半天时间。
pom.xml
 
<build>
    <plugins>
        <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>
    </plugins>
</build>
 
  1. Another way is to edit the project facet configuration file itself: org.eclipse.wst.common.project.facet.core.xml
  2. Change the dynamic web module version in this line to 3.1 – <installed facet="jst.web" version="3.0"/>
  3. And then Maven -> Update Project. You’ll find this file in the .settings directory within the Eclipse project

以上是关于maven 构建项目时出错 “Dynamic Web Module 3.1 requires Java 1.7 or newer” in Eclipse的主要内容,如果未能解决你的问题,请参考以下文章