eclipse建立的maven項目,pom.xml文件報錯解決方法

【錯誤一:】maven 編譯級別太低java

【解決辦法:】 使用 maven-compiler-plugin 將 maven 編譯級別改成 jdk1.6 以上:web

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

【解決辦法:】maven

<!-- 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>
相關文章
相關標籤/搜索