Maven打包时报Failed to execute goal org.apache.maven.plugins:maven-war-plugin:解决方案
问题现象:
用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>
Maven打包时报Failed to execute goal org.apache.maven.plugins:maven-war-plugin:解决方案的更多相关文章
- Maven打包异常:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war
出现下面异常,因为默认web.xml在 src/main/webapp 下所以才出现找不到的异常. 我的项目结构为 解决办法①: 在pom.xml里面制定 web位置即可 //先确保打包方式为w ...
- 使用idea maven打包项目 Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources
超级折磨人 在网上搜到的解决方案: 技术交流群 : 816227112 修改 和 <plugin> <groupId>org.apache.maven.plugins</ ...
- Maven 错误:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project appservice-common: Fatal error compiling: 无效的目标发行版: 1.8
通过IDEA 提供的面板 执行package 或者 install 没有错误,但是cmd terminal 窗口就不行!出现: Maven 错误:Failed to execute goal org. ...
- maven 编译出错 Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean
eclipse在使用maven的tomcat控件编译java程序时,报错 Failed to execute goal org.apache.maven.plugins:maven-clean-plu ...
- maven bug之Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project acSpaceCommon: Fatal error compiling: tools.jar not found: C:\Program Files\J
maven打包项目的时候一直报这个异常 一般的解决办法我都试过 在pom.xml加代码 也不行 只有10分了 求大神解答 这是因为测试代码时遇到错误,它会停止编译.只需要在pom.xml的< ...
- springboot打包 出错 Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1
遇到这个问题看了很多博客之后发现:执行这个语句就行了:mvn clean package -Dmaven.test.skip=true 本文链接:https://blog.csdn.net/weixi ...
- maven build时报错Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
[INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ ...
- 解决Failed to execute goal org.apache.maven.plugins
1.Maven构建失败 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:3.1:compile 解决办法
Maven install失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (d ...
随机推荐
- 1 - apicloud - str 字符串拼接技术
<body> <label>Hello APP</label> <div id='sys-info'></div></body> ...
- Django学习路线
- <mvc:default-servlet-handler />说明
优雅REST风格的资源URL不希望带 .html 或 .do 等后缀.由于早期的Spring MVC不能很好地处理静态资源,所以在web.xml中配置DispatcherServlet的请求映射,往往 ...
- C# 直接使用sql语句对数据库操作 (cmd.ExecuteNonQuery)
只介绍读和删 不管使用什么方法来对数据库进行操作都绕不开和数据库的连接问题,所以咱们先在App.config中添加连接字段 <connectionStrings> <add name ...
- oracle11g忘记管理员密码
oracle的sys和system密码是我们经常忘记的,忘记之后我们可以通过sqlplus来修改重置. 首先打开sqlplus:在运行处可直接输入打开 进入窗口后,首先输入 sqlplus/as sy ...
- HDU-1114 完全背包+恰好装满问题
B - Piggy-Bank Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Subm ...
- [BJDCTF2020]Easy MD5
0x00 知识点 password='".md5($pass,true)."' 链接: https://www.jianshu.com/p/12125291f50d ffifdy ...
- JZOJ823PJ-C, TG-B
分身打两场比赛 PJ - C 翻车 T1 原题, 考虑蚂蚁相撞时其实不用管. 然后写个取左右max, 左右min的即可 翻车: 注释freopen后JZOJ不会提示!(大翻车--丢了300分) T2 ...
- 修改maven默认仓库(即repository)的路径
原文链接:https://blog.csdn.net/ideality_hunter/article/details/53006188 简要说明:主要操作为新建仓库路径,在maven的conf目录下修 ...
- D语言-变量、输入、输出、注释
Part 1:变量 D语言的变量有很多类型,这里只讨论几个基本类型 §1.1变量的定义方法 在D语言中,变量的定义方法是这样子的: [typename] [var1,var2,var3...] 其中, ...