.personSunflowerP { background: rgba(51, 153, 0, 0.66); border-bottom: 1px solid rgba(0, 102, 0, 1); border-top-left-radius: 7px; border-top-right-radius: 7px; color: rgba(255, 255, 255, 1); height: 1.8em; line-height: 1.8em; padding: 5px }

问题描述:有时候新建的maven工程后,项目的pom.xml中报错:web.xml is missing and <failOnMissingWebXml> is set to true

如图:

解决分两种情况(三种解决方法):

1.若项目中不需要web.xml文件,且不是Web工程,则直接在pom.xml文件中加入以下配置,然后update一下项目:

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

2.项目是Web工程,则需要web.xml文件(两种解决方案)

  1)最简单最直接的是在src/main/webapp/下新建WEB-INF/web.xml(也可以从其他项目中拷贝一个web.xml过来),如下图。然后刷新项目:

  2)最可靠的是让项目自动 WEB-INF/web.xml生成。操作步骤如下:

    ①右击项目,然后点击Properties-->Project Facets,将在右侧Dynamic Web Module选中项去除,再点击Apply(应用)。

    

    ②然后重新勾选Dynamic Web Module,点击下方的Further configuration available... 在弹出的窗口中配置Content directory的值填入:src/main/webapp,点击ok ,再点击Appy --> Apply and Close.刷新工程即可。如下图:

    

    ③完成后,自动生成的结构如下图,非常完整:

  若过程中还有其他问题,欢迎留言一起解决。

pom.xml中web.xml is missing and <failOnMissingWebXml> is set to true错误的解决的更多相关文章

  1. 解决Eclipse里的Maven工程pom.xml文件报:web.xml is missing and <failOnMissingWebXml> is set to true错误

    打开eclipse准备进行开发时,发现项目上有个红星号,查看错误后发现报了一个:"web.xml is missing and <failOnMissingWebXml> is ...

  2. 创建Maven web项目时 出现 web.xml is missing and <failOnMissingWebXml> is set to true错误 pox.xml编译错误

    今天创建一个maven项目 pom.xml出现如下错误: web.xml is missing and <failOnMissingWebXml> is set to true 这是因为你 ...

  3. web.xml is missing and <failOnMissingWebXml> is set to true 错误解决办法

    对web项目的解决方案: 右击项目——>Java EE Tools——>Generate Deployment Descriptor Stub. 然后系统会在src/main/webapp ...

  4. 创建Maven项目时提示web.xml is missing and <failOnMissingWebXml> is set to true错误解决方案

    1. 右键点击Deployment Descriptor 2. 选择Generate Deployment Descriptor Stub P.S.下面顺便提一个小技巧: 创建动态web时先右键项目, ...

  5. 【maven】maven创建web项目-pom文件提示web.xml is missing and <failOnMissingWebXml> is set to true

    使用maven创建web项目,选择war类型后,pom文件红叉 提示web.xml is missing and <failOnMissingWebXml> is set to true ...

  6. pom.xml出现web.xml is missing and <failOnMissingWebXml> is set to true解决方案

    提示信息应该能看懂.也就是缺少了web.xml文件,<failOnMissingWebXml>被设置成true了. 搜索了一下,Stack Overflow上的答案解决了问题,分享一下. ...

  7. 解决maven项目中web.xml is missing and <failOnMissingWebXml> is set to true

    web.xml is missing and <failOnMissingWebXml> is set to true 是因为项目中没有web.xml文件, 步骤如下:

  8. maven的pom报错web.xml is missing and <failOnMissingWebXml> is set to true

    错误信息:web.xml is missing and <failOnMissingWebXml> is set to true 解决办法:https://blog.csdn.net/si ...

  9. 解决 web.xml is missing and <failOnMissingWebXml> is set to true 报错

    在学习maven模块化构建项目的时候遇到了如下报错信息: web.xml is missing and <failOnMissingWebXml> is set to true. 这时候需 ...

随机推荐

  1. 14.6、redis集群

    1.环境配置: 服务器名称 ip地址 实例6379 实例6380 实例6381 实例6381 实例6381 实例6381 controller-node1 172.16.1.90 主 从 主 从 主 ...

  2. flex PopUpManager createPopUp方式弹出窗口

    createPopUp:是上来先设置好弹出方式,然后在new出来一个TitleWindow的对象,然后通过此对象设置他的变现形式. addPopUp:是先new出来对象,设置好表现形式,然后在选择弹出 ...

  3. C# 实现复制Excel内容到DataGridview中

    业务要求:复制:将Excel内容复制到datagridview中 最终效果:复制Excel内容,点击datagridview中的某个单元格,顺着这个单元格自动填充自动增加行.偷懒了,没写填充在选择哪些 ...

  4. ACM金牌选手整理的【LeetCode刷题顺序】

    算法和数据结构知识点图 首先,了解算法和数据结构有哪些知识点,在后面的学习中有 大局观,对学习和刷题十分有帮助. 下面是我花了一天时间花的算法和数据结构的知识结构,大家可以看看. 后面是为大家 精心挑 ...

  5. ExtJs4学习(九)读写器reader、writer

    Ext.data.reader.Json JSON Reader是用一个代理来读取服务端响应的JSON格式的返回值. 一般用于将结果加载成一个存储集-例如我们将创建一些如下东西: Ext.define ...

  6. mysql某建表语句

    CREATE TABLE `product_info`( `product_id` VARCHAR(32) NOT NULL COMMENT '主键', `product_name` VARCHAR( ...

  7. netcore3.1 + vue (前后端分离)生成PDF(多pdf合并)返回前端打印

    1.使用Adobe Acrobat XI Pro编辑pdf模板 2.公共类代码 3.service层调用 4.Controller层 5.前端(Vue) 因为print.js不支持宋体,所以打算用后台 ...

  8. Github Copilot 结合python的使用

    之前提交的github copilot技术预览版申请,今天收到准入邮件,于是安上试一试这个准备把我送去电子厂上班的copy a lot ? 官网及申请地址:https://copilot.github ...

  9. docker容器技术基础之linux cgroup、namespace

    一.开头 接触过docker的同学多多少少听过这样一句话"docker容器通过linux namespace.cgroup特性实现资源的隔离与限制".今天我们来尝试学习一下这两个东 ...

  10. 学生信息管理系统--基于jsp技术和MySQL的简单增删改查

    web实现增删改查的方式有很多啊,对于初学者来说当然是要先了解各部分的传值的方式.本篇博客从jsp技术的最基础方面进行说明. 一.什么是jsp技术 首先,我们要了解什么是jsp技术. jsp技术是基于 ...