maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-wa

转载 2016年06月01日 08:43:18

maven打包成war时,报错:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project web_nanchang: Error assembling WAR: webxml attribute is required 
原因:找不到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>

maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war

maven打包成war时,报错:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-...
  • xiaomageit
  • xiaomageit
  • 2016-03-16 21:52:28
  • 742

【maven install报错】Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war

maven install报错如下:[INFO] Scanning for projects... [INFO] Downloading: http://xxx.xx.xx.x:xxxx/nexus/...
  • lmb55
  • lmb55
  • 2017-07-27 08:41:49
  • 1924

Failed to execute goal org.apache.maven.plugins:maven-war-plugin 解决办法

使用maven打包时,报错误信息:[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (d...
  • a_bang
  • a_bang
  • 2017-06-03 01:35:12
  • 5967

Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project Th

错误信息:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on proje...
  • mafan121
  • mafan121
  • 2015-11-08 16:57:32
  • 3579

Maven打包时报Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war解决方案

问题现象: 用Maven打包时,报Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war错误。 原因分析:...
  • StemQ
  • StemQ
  • 2016-10-25 15:19:30
  • 22477

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on pr

以前是在eclipse中将maven项目打包,今天在idea打包maven项目中遇到错误信息[ERROR] Failed to execute goal org.apache.maven.plugin...
  • LEoe_
  • LEoe_
  • 2017-10-25 21:17:06
  • 378

解决maven打war包报错:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2

一、报错经历:今天使用eclipse通过maven install打war包的时候,出现了下图所示的错误二、问题分析:不能执行依赖包maven-compiler-plugin:2.3.2,判断原因是缺...
  • qq_26230421
  • qq_26230421
  • 2018-02-05 11:51:18
  • 926

maven install时报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile,

maven install时报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile,...
  • big_bigwolf
  • big_bigwolf
  • 2016-08-23 15:36:25
  • 1030

Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on p

  • wabiaozia
  • wabiaozia
  • 2017-01-19 20:01:00
  • 438
收藏助手
不良信息举报
您举报文章:maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-wa
举报原因:
原因补充:

(最多只允许输入30个字)