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

参考: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>

 

原文地址:https://www.cnblogs.com/bluedeblog/p/7401913.html