maven pom.xml中出现错误failOnMissingWebXml Dynamic Web Module 3.1 requires Java 1.7 or newer,每次update后都会回滚到1.5解决方案

web项目中/maven项目中容易出现的2个错误

1、web.xml is missing and <failOnMissingWebXml> is set to true pom.xml / line 7 Maven Java EE Configuration Problem

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
    </plugins>
</build>

2、Dynamic Web Module 3.1 requires Java 1.7 or newer. line 1 Maven Java EE Configuration Problem
Java compiler level does not match the version of the installed Java project facet. Unknown Faceted Project Problem (Java Version Mismatch)

<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>

 

posted on 2019-09-10 00:24  牛鼻子老赵  阅读(216)  评论(0编辑  收藏  举报