我是靠谱客的博主 义气羽毛,这篇文章主要介绍web.xml is missing and is set to true,现在分享给大家,希望可以做个参考。

pom.xml文件里<packaging>war</packaging>出现下面的错误:
web.xml is missing and <failOnMissingWebXml> is set to true

要解决这个问题,最好的办法是在pom.xml文件中添加下面的插件配置:

复制代码
1
2
3
4
5
6
7
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin>

当然,还可以试试下面的几种方法:

  1. 右击项目-Properties-Deployment Assembly-add-Folder-src-main-webapp。这个是在webapp下加入了web.xml后还有叉叉才用的。
  2. 右击项目——>Java EE Tools——>Generate Deployment Descriptor Stub。然后系统会在src/main/webapp/WEB_INF文件加下创建web.xml文件。

最后

以上就是义气羽毛最近收集整理的关于web.xml is missing and is set to true的全部内容,更多相关web.xml内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(51)

评论列表共有 0 条评论

立即
投稿
返回
顶部