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]

错误如下图所示:

maven项目打war包报错,找不到web.xml文件

2、解决方式:在pom.xml文件中添加如下配置:

    <properties>
        <failOnMissingWebXml>false</failOnMissingWebXml>
    </properties>

再次打包成功,如下图:

maven项目打war包报错,找不到web.xml文件

 

相关文章:

  • 2021-05-09
  • 2021-06-29
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-06-09
  • 2021-08-27
猜你喜欢
  • 2022-02-07
  • 2021-07-10
  • 2021-07-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-15
相关资源
相似解决方案