maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project web_nanchang

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>

时间: 2024-08-02 19:17:07

maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project web_nanchang的相关文章

maven报 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile(defalut-compile) on project 项目名称:No such compile &#39;javac&#39;

这个问题纠结了一天,在另外一个电脑是正常的,但是从服务器下载下来到另外一个电脑的时候却出现了如下图问题 看到javac大家都会想到是编译出现问题,而本地的配置如下图所示: 看着配置都是一致的,会是哪里的问题呢?经网上咨询有个大神说是可能是maven没有配置指定的jdk原因,原因如下: maven是个项目管理工具,如果我们不告诉它我们的代码要使用什么样的jdk版本编译的话,它就会用maven-compiler-plugin默认的jdk版本来进行处理,这样就容易出现版本不匹配的问题,以至于可能导致编

Maven错误“Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create ”解决

用maven3新建一个项目时,输入的命令如下: mvn archetype:create 出现错误如下: [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 mojo org.apache.maven.plugins:mav

maven笔记——Failed to execute goal org.apache.rat:apache-rat-plugin:0.7:check (verify.rat) on project flume-ng-c

解决办法: 在每个新建的类的第一行加入以下内容即可 /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF l

mvn install 报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2 错误: 找不到符号

报错信息 在Eclipse中执行mvn install时,console端显示如下报错信息: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project ERP: Compilation failure: Compilation failure: [ERROR] \test01\src\main\java\HStyl

解决maven项目 maven install失败 错误 Failed to execute goal org.apache.maven.plugins

1.Maven构建失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin: 2.3.4 :compile ( default -compile) on project oecp: Compilation failure 2.解决方法:使用自己的jdk,记住是jdk,因为jdk里本身包含jre.而不是单纯的jre.本人初学者,表达肤浅,请看勿笑. 解决maven项目 maven install失败 错误 Fa

解决maven install报错信息(Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile )

Maven install失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project autotest_fchtgl: Compilation failure[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE r

maven install时报错 Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test)

今天在一个maven项目上执行maven install命令的时候一直报错,错误信息如下: [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.16

针对maven install 报错:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1 解决方案

项目运行环境:jdk1.8+tomcat8 maven install 时报错:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1 造成此错误的原因也比较多,下面分2种情况: 情况1(常见):你可能编译在一个JRE而不是JDK上,maven 编译是要JDK的,即你的编译器配置了一个jre路径,需要换成jdk. 操作:window→preference→java→Installed JREs 点add添

Maven Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean Failed to delete access_log

I'm trying to run simple struts project using maven and tomcat. When I'm trying to exucute next goals:clean install tomcat7:run ,there is an error : [ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean)