Maven打包时报Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war解决方案
来源:互联网 发布:spss数据分析课程 编辑:程序博客网 时间:2024/06/06 00:56
问题现象:
用Maven打包时,报Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war错误。
原因分析:
打包时在WebContent/WEB-INF/文件夹下找不到web.xml文件。
解决方案:
如果WebContent/WEB-INF/web.xml文件存在,需要在pom.xml文件的<build>节点中,加上maven-war-plugin插件配置。
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <version>3.0.0</version>
- <configuration>
- <webResources>
- <resource>
- <directory>WebContent</directory>
- </resource>
- </webResources>
- </configuration>
- </plugin>
- </plugins>
如果WebContent/WEB-INF/web.xml文件不存在,则按下面的方式配置。
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <version>3.0.0</version>
- <configuration>
- <failOnMissingWebXml>false</failOnMissingWebXml>
- </configuration>
- </plugin>
- </plugins>
阅读全文
0 0
- 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解决方案
- maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.6:war
- Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project Th
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on pr
- 【maven install报错】Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war
- 创建maven web项目 pom报错:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war
- Failed to execute goal org.apache.maven.plugins:maven-war-plugin 解决办法
- maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-wa
- maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-wa
- maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-wa
- maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-wa
- maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-wa
- maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-wa
- maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-wa
- maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-wa
- maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-wa
- 分享几个好看的Bootstrap后台管理响应式模板
- typescript引入项目同步json文件方法总结
- 关于脚本的执行路径问题
- iOS开发中屏幕旋转至一个方向后再手动设置屏幕旋转至该方向无效问题
- SpringMVC 拦截器不拦截静态资源的三种处理方式
- Maven打包时报Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war解决方案
- TensorFlow框架(4)之CNN卷积神经网络详解
- 路由器 无线桥接
- ionic2 问题
- iOS开发稀碎小技巧三
- Node 127.0.0.1:7001 is not empty. Either the nodealready knows other nodes
- vs2010 问题 >LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
- hdu 6182A Math Problem/2017ACM/ICPC广西邀请赛
- 架构设计基础