maven项目打war包报错,找不到web.xml文件
1、错误情况描述:今天在用maven打包的时候,一直报错,提示找不到web.xml,错误提示为:
Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project child2: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]
错误如下图所示:
2、解决方式:在pom.xml文件中添加如下配置:
<properties>
<failOnMissingWebXml>false</failOnMissingWebXml>
</properties>
再次打包成功,如下图: