【maven】web项目不需要web.xml,maven打包报错
来源:互联网 发布:2017中超球员数据 编辑:程序博客网 时间:2024/06/05 13:28
在maven 打包war包的时候,它会要求/WEB-INF目录下有web.xml文件,但是在servlet 3.0之后,对于web.xml文件本身是可选的,当我用maven打包的时候报错如下错误:
[INFO] ------------------------------------------------------------------------[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project core-frontend: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1][ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable full debug logging.
解决方式有两个:
1 在pom.xml文件中定义一个参数配置
<properties> <failOnMissingWebXml>false</failOnMissingWebXml> </properties>
2 另外你可以更新maven的默认的maven-war-plugin
<plugin> <artifactId>maven-war-plugin</artifactId> <version>3.0.0</version></plugin>
参考:
https://stackoverflow.com/questions/33390460/maven-error-assembling-war-webxml-attribute-is-required-when-building-the-sprin
https://www.mkyong.com/maven/maven-webxml-attribute-is-required/
阅读全文
0 0
- 【maven】web项目不需要web.xml,maven打包报错
- maven web项目pom.xml文件头部报错
- 使用maven打包web项目
- maven web项目打包部署
- myeclipse maven web项目打包
- Maven打包web项目报错Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if
- Maven打包web项目报错Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if
- eclipse中maven web项目maven bulid报错
- maven构造web项目 web.xml更改
- maven web项目配置1-web.xml
- MAVEN创建并打包web项目
- eclipse创建maven web项目时,pom.xml文件报错
- eclipse新建maven的web项目时,pom.xml的war报错解决方法
- eclipse maven项目pom报错web.xml is missing and <failOnMissingWebXml> is set to true
- 非maven项目部署web项目报错,ClassNotFoundException
- eclipse中maven因没有web.xml报错
- Maven部署Web项目报错webxml attribute is required
- Eclipse创建Maven web项目jsp表头报错
- 关于闭包
- bzoj 1552: [Cerc2007]robotic sort && bzoj 3506: [Cqoi2014]排序机械臂(splay区间翻转)
- html5手机网站需要加的那些meta标签,手机网站自适应
- java基础——多维数组
- 正则表达式
- 【maven】web项目不需要web.xml,maven打包报错
- 《机器学习实战》学习笔记(一)
- PS学习—人像处理
- C语言恶作剧(1):交换鼠标左右键
- Leetcode-033 Search in Rotated Sorted Array
- 算法学习之旅,初级篇(11)--凯撒的密码
- 内部类
- 关于CSS-RESET的浅析和个人理解
- ColorFilter的使用