maven打包成war时,报错: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project child02: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]
错误原因: 找不到web.xml,但是项目中明明有这个文件,在WebContent/WEB-INF/文件夹下,就是识别不了
解决方法:
需要在pom.xml文件中,加上maven-war-plugin插件配置
在<build>节点中增加:

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<webResources>
<resource>
<directory>WebContent</directory>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>

如果项目中原本没有web.xml文件,就需要加上下面的配置:

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

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project child02的更多相关文章

  1. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3.1:

    security-sdk-1.0.jar已经存在于D:/secServerSDK-test/src/main/resources/lib下 报错如下: xxxxxx@xxxxxxxx /d/secSe ...

  2. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (default-cli) on project standalone-pom: Unable to parse configuration of 3: mojo org.apache.maven.plugins:

    问题: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (defau ...

  3. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar (default-jar) on

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar (default-jar) on ...

  4. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project triage: Compilation failure [ERROR] No compiler is provided in this environment.

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-c ...

  5. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project taotao-manager-pojo: Compilation failure

    运行maven项目时报错 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compi ...

  6. Maven进行install的时候报错,COMPILATION ERROR : Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.13:test (default-test) on project cmu: There are test failures.

    maven进行install的时候,test类里面报错: COMPILATION ERROR : [INFO] -------------------------------------------- ...

  7. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4: install (default-install) on project authorizationManagement-service: Failed to install metadata com.dmsdbj.itoo:autho

    今天在打包时遇到这个问题: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4: inst ...

  8. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war

    创建springboot项目,且不采用<parent>引入springboot时,pom.xml如下: <?xml version="1.0" encoding= ...

  9. mvn clean package:[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12

    原文地址:https://www.cnblogs.com/lxcy/p/8279899.html 事故现场: 解决办法: 一是命令行, mvn clean package -Dmaven.test.s ...

随机推荐

  1. 转 c#性能优化秘密

    原文:http://www.dotnetperls.com/optimization Generally, using the simplest features of the language pr ...

  2. 到位App_jQuery_art-template

    到位 App 不写 node 服务器,本地模拟 ajax 获取 json 数据 源代码 ---- 参见 ---- 使用 webstorm 运行 index.html 本地静态的 data.json 前 ...

  3. python scrapy框架爬取豆瓣

    刚刚学了一下,还不是很明白.随手记录. 在piplines.py文件中 将爬到的数据 放到json中 class DoubanmoviePipelin2json(object):#打开文件 open_ ...

  4. CUDA编程模型

    1. 典型的CUDA编程包括五个步骤: 分配GPU内存 从CPU内存中拷贝数据到GPU内存中 调用CUDA内核函数来完成指定的任务 将数据从GPU内存中拷贝回CPU内存中 释放GPU内存 *2. 数据 ...

  5. Python-常用字符串操作

    name = 'shanbaoliang.exe' print(name.capitalize()) #将字符串首字母大写 print(name.center(50,'-')) #把字符串居中,并用特 ...

  6. Retrofit 实现获取往里圆角图片,且传值到另一个页面

    记得加网络权限 java包: // compile 'jp.wasabeef:glide-transformations:3.0.1' implementation 'com.squareup.ret ...

  7. NeuChar 平台使用及开发教程 索引

    什么是 NeuChar? NeuChar 是由盛派(Senparc)团队发布的新一代跨平台服务系统,其中包含了开放的跨平台通讯标准及核心计算模块(Senparc.NeuChar.dll)以及配套的云管 ...

  8. 十几分钟让你学会MySQL布尔和延迟盲注手工操作

    作者:Max老白Gān丶链接:http://www.lofter.com/lpost/1fefbc76_12d25dc31来源:LOFTER 注入常用到的几个函数   1 mid(str,1,3) 字 ...

  9. [Swift]LeetCode94. 二叉树的中序遍历 | Binary Tree Inorder Traversal

    Given a binary tree, return the inorder traversal of its nodes' values. Example: Input: [1,null,2,3] ...

  10. [Swift]LeetCode319. 灯泡开关 | Bulb Switcher

    There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every ...