问题描述

使用Maven打包项目的时候,出现错误:
webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update)

原因分析

web项目下缺少WEB-INF/web.xml

当是在servlet 3.0之后,对于web.xml文件本身是可选的

解决方案

第一种、在pom.xml文件中定义一个参数配置

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

第二种、更新maven-war-plugin的版本

<plugin>
  <artifactId>maven-war-plugin</artifactId>
  <version>3.0.0</version>
</plugin>

第三种、在webapp目录下创建WEB-INF/web.xml
Maven打包web项目报错:webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update)

相关文章:

  • 2021-08-07
  • 2022-02-12
  • 2021-09-16
  • 2021-06-14
  • 2022-02-06
  • 2022-12-23
  • 2021-07-15
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案