分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 技术分享

web.xml is missing and <failOnMissingWebXml> is set to true

发布时间:2023-09-06 01:28责任编辑:蔡小小关键词:Webxml

使用maven创建项目时有时在pom.xml的war处出现failOnMissingWebXml的错误,根据错误提示的原因可以知道项目是web项目,打包时打成war包。

如果项目里没有web.xml,在项目里添加一个web.xml,刷新一下项目,就应该没有错误,如果还有请看下面的介绍

 如果你的项目在 /src/main/webapp/WEB-INF 下有web.xml,但是仍然还是报这个错误,需要两步操作

1)右击项目,打开Properties对话框,点击Deployment Assembly选项,在右边添加一个文件夹,并且保存设置

2)在eclispe上方点击Project ->Clean 清理一下这个项目

经过这两步错误就应该已经清楚了

还有一种网上很常见的做法 

有提供一个变相规避错误的方法,添加配置,放过该错误提示。

<build> ?????<plugins> ?????????<plugin> ?????????????<groupId>org.apache.maven.plugins</groupId> ?????????????<artifactId>maven-war-plugin</artifactId> ?????????????<version>2.3</version> ?????????????<configuration> ?????????????????<failOnMissingWebXml>false</failOnMissingWebXml> ?????????????</configuration> ?????????</plugin> ?????</plugins> ?</build
 

 

web.xml is missing and <failOnMissingWebXml> is set to true

原文地址:http://www.cnblogs.com/lwx521/p/7977565.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved