Maven打包web项目报错:webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update)
生活随笔
收集整理的這篇文章主要介紹了
Maven打包web项目报错:webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update)
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
問(wèn)題描述
使用Maven打包項(xiàng)目的時(shí)候,出現(xiàn)錯(cuò)誤:
webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update)
原因分析
web項(xiàng)目下缺少WEB-INF/web.xml
當(dāng)是在servlet 3.0之后,對(duì)于web.xml文件本身是可選的
解決方案
第一種、在pom.xml文件中定義一個(gè)參數(shù)配置
<properties><failOnMissingWebXml>false</failOnMissingWebXml></properties>第二種、更新maven-war-plugin的版本
<plugin><artifactId>maven-war-plugin</artifactId><version>3.0.0</version> </plugin>第三種、在webapp目錄下創(chuàng)建WEB-INF/web.xml
總結(jié)
以上是生活随笔為你收集整理的Maven打包web项目报错:webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 前端问题:button按钮在form表单
- 下一篇: tomcat8+在maven中热部署