【maven 报错】maven项目执行maven install时报错Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
在使用maven新建的web项目中,执行

执行如上的这两个操作,报错:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project bioligyInfo: Fatal error compiling: tools.jar not found: C:\Program Files\Java\jre1.8.0_73\..\lib\tools.jar -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project bioligyInfo: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
上面的两种错误,提示的很明显:
错误1:

其实不用从maven下载插件,只需要保证你的pom.xml文件中有如下的信息即可:
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<version>2.5</version>
</configuration>
</plugin>
</plugins>
</build> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>4.1.4.RELEASE</spring.version>
<hibernate.version>4.3.8.Final</hibernate.version>
<jackson.version>2.5.0</jackson.version> </properties>
错误2:

提示找不到web.xml文件
解决方法:
1》如果你没有配置web.xml文件,那就创建web.xml文件
2》如果你配置了web.xml文件,还有这样的错误,那就是你的web.xml文件不能被你项目读取到
如下,项目中web.xml的位置如下:

而我们需要让项目读取到它:

因为web.xml文件的路径如下:src\main\webapp\WEB-INF\web.xml
如果依旧无法解决,那就在pom.xml文件中配置如下:
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<version>2.5</version>
<webXml>src\main\webapp\WEB-INF\web.xml</webXml>
</configuration>
</plugin>
</plugins>
</build>
这样指定到具体的文件上 就可以解决这问题了。
【maven 报错】maven项目执行maven install时报错Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)的更多相关文章
- Maven打包项目失败;报错:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project Hello: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/we
报错信息: E:\MIKEY\mikey\HTML5\TestMaven_01>mvn package [INFO] Scanning for projects... [INFO] [INFO] ...
- MAVEN项目打包报错:Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on pr ...
- SpringBoot发布WAR启动报错:Error assembling WAR: webxml attribute is required
Spring Boot发布war包流程: 1.修改web model的pom.xml <packaging>war</packaging> SpringBoot默认发布的都是j ...
- 008-SpringBoot发布WAR启动报错:Error assembling WAR: webxml attribute is required
一.Spring Boot发布war包流程: 1.修改web model的pom.xml <packaging>war</packaging> SpringBoot默认发布的都 ...
- php项目执行composer install时报错
报错信息: Loading composer repositories with package informationInstalling dependencies (including requi ...
- (转)Linux安装SwfTools-0.9.2安装事,在执行make install时报错
系统:CentOS6.5 安装SwfTools-0.9.2的时候,在执行make install时报错, rm -f /usr/local/share/swftools/swfs/default_vi ...
- vue项目在执行npm install时报错
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning ETIMEDOU ...
- Xcode9,cocoaPod执行pod install时报错,一行命令即可解决。
- Maven打包web项目报错:webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update)
问题描述 使用Maven打包项目的时候,出现错误: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing ...
随机推荐
- Mybatis中的in查询和foreach标签
Mybatis中的foreach的主要用在构建in条件中,它可以在SQL语句中进行迭代一个集合. foreach元素的属性主要有 item,index,collection,open,separato ...
- opencv-3.x.0-x86-mingw32-staticlib-gcc5.3.0-20160712.7z
折腾了半天 用 cmake 3.5.0 + gcc5.3.0 编译 opencv3.x.0 静态库 opencv-3.0.0-x86-mingw32-staticlib-gcc5.3.0-201607 ...
- 15.SpringMVC和Spring上下文关系(为什么SpringMVC可以调用到Spring)
springmvc上下文继承于spring, 也就是springmvc的上下文可访问spring上下文,在springmvc的上下文中可取得spring bean. spring上下文是spring启 ...
- yii框架详解 之 CActiveRecord
[特别注意事项] 1.所有要用于访问的属性,都要先在类中声明(原数据表中的字段是默认可访问的,自定义的属性值,一定要先在类中添加声明,才可以正常访问) 2.数据库的表面引用,一般都是有固定的数据库表前 ...
- xdebug安装
sudo apt-get install php-pearsudo apt-get install php5-devsudo pecl install xdebug 下载安装编译完后,在php.ini ...
- nyoj739_笨蛋难题四
笨蛋难题四 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 这些日子笨蛋一直研究股票,经过调研,终于发现xxx公司股票规律,更可喜的是 笨蛋推算出这家公司每天的股价, ...
- telnet测试制定地址端口号
cmd下,命令 telnel+空格+ip或者网站+空格+端口号 端口可以用: 需要开通windows服务:
- JavaScript高级程序设计学习笔记--函数表达式
关于函数声明,它的一个重要特征就是函数声明提升,意思是在执行代码之间会读取函数声明,意思是在执行代码之前会先读取函数声明.这就意味着可以把函数声明放在调用它的语句 后面. sayHi(); funct ...
- php数据访问(修改)
修改:跟添加相似,需要显示默认值 先嵌入php代码 查询数据库 $code = $_GET["c"]; $db = new MySQLi("localhost" ...
- flume学习
下载 自定义sink(mysql) 1.ide打开下载后的源码 2.代码如下: /** * Licensed to the Apache Software Foundation (ASF) under ...