eclipse创建的maven项目,pom.xml文件报错解决方法

【错误一:】maven 编译级别过低

【解决办法:】 使用 maven-compiler-plugin 将 maven 编译级别改为 jdk1.6 以上:

<!-- java编译插件 -->
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
        <encoding>UTF-8</encoding>
    </configuration>
</plugin>

【错误二:】显示错误:web.xml is missing and <failOnMissingWebXml> is set to true

【解决办法:】

<!-- pom.xml的war报错解决方法 -->
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.3</version>
    <configuration>
        <span style="white-space:pre;">
        </span>
        <failOnMissingWebXml>false</failOnMissingWebXml>
    </configuration>
</plugin>

猜你喜欢

转载自www.cnblogs.com/mmzs/p/9229329.html