1. 程式人生 > >web.xml is missing and <failOnMissingWebXml> is set to true

web.xml is missing and <failOnMissingWebXml> is set to true

con 錯誤 eba 錯誤提示 應該 b- XML web rop

參考:http://blog.csdn.net/liuvlun/article/details/50218507

使用maven創建項目時有時在pom.xml的war處出現failOnMissingWebXml的錯誤,根據錯誤提示的原因可以知道項目是web項目,打包時打成war包。

如果項目裏沒有web.xml,在項目裏添加一個web.xml,刷新一下項目,就應該沒有錯誤,如果還有請看下面的介紹

如果你的項目在 /src/main/webapp/WEB-INF 下有web.xml,但是仍然還是報這個錯誤,需要兩步操作

1)右擊項目,打開Properties對話框,點擊Deployment Assembly選項,在右邊添加一個文件夾,並且保存設置

2)在eclispe上方點擊Project ->Clean 清理一下這個項目

經過這兩步錯誤就應該已經清楚了

或者是

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

web.xml is missing and <failOnMissingWebXml> is set to true