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.2:war

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

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

maven 项目发布到私有库 nexus

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)

1. 跟着《Maven实战》练习时,编译第一个Maven项目Hello World编译报错了,错误如下: 环境:Intellij IDEA 13.1.4 + Maven 3.2.3Unavaila...

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile)

完整的错误信息:[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (d...

[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/...

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,...

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin

在使用Maven以及Eclipse的Maven插件时,我和同事遇到了一下几个问题,本着知其然知其所以然的学习精神,总结如下: Unrecognised tag 问题 由于我使用本地代理仓库,所以se...

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile

1. 好坑呐,一个问题解决了好久才解决。终于可以了不容易啊。 跟着《Maven实战》学习第一个项目就出问题。Compile通过了,可是Test时有问题。网上报这个错的大部分用的都是Eclipse的。...

window10下编译hadoop报错:Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:

Windows10 下build hadoop2.7.3报错:[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-...

【Maven】用maven后台打包报错Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (def

1.问题: 使用maven后台打包报错,报错结果如下:"C:\Program Files\Java\jdk1.8.0_91\bin\java" -Dmaven.multiModuleProjectD...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-wa
举报原因:
原因补充:

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