在使用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)的更多相关文章

  1. 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] ...

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

  3. SpringBoot发布WAR启动报错:Error assembling WAR: webxml attribute is required

    Spring Boot发布war包流程: 1.修改web model的pom.xml <packaging>war</packaging> SpringBoot默认发布的都是j ...

  4. 008-SpringBoot发布WAR启动报错:Error assembling WAR: webxml attribute is required

    一.Spring Boot发布war包流程: 1.修改web model的pom.xml <packaging>war</packaging> SpringBoot默认发布的都 ...

  5. php项目执行composer install时报错

    报错信息: Loading composer repositories with package informationInstalling dependencies (including requi ...

  6. (转)Linux安装SwfTools-0.9.2安装事,在执行make install时报错

    系统:CentOS6.5 安装SwfTools-0.9.2的时候,在执行make install时报错, rm -f /usr/local/share/swftools/swfs/default_vi ...

  7. vue项目在执行npm install时报错

    npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning ETIMEDOU ...

  8. Xcode9,cocoaPod执行pod install时报错,一行命令即可解决。

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

随机推荐

  1. Python~函数的参数

    def func(a,b,c,*args,**kw): print('a=',a,'b=',b,'c=',c,'args=',args,'kw=',kw) 必选参数,默认参数,可变参数,关键字参数 d ...

  2. 简述memcached中的一致哈希

    memcached是一个开源的高性能分布式内存对象缓存系统. 其实思想还是比较简单的,实现包括server端(memcached开源项目一般只单指server端)和client端两部分: server ...

  3. 【python】入门学习(三)

    for循环 for i in range():   #注意冒号 range中默认从0开始 或者从指定的数字开始 到给定数字的前一个数字结束 递增递减皆是如此 for循环提供变量的自动初始化 for i ...

  4. iOS 中CoreData的简单使用

    原文链接:http://www.jianshu.com/p/4411f507dd9f 介绍:本文介绍的CoreData不在AppDelegate中创建,在程序中新建工程使用,即创建本地数据库,缓存数据 ...

  5. Spring控制反转与依赖注入(IOC、DI)

    IOC: 反转控制   Inverse Of Control DI:依赖注入 Dependency Injection 目的:完成程序的解耦合 解释:在应用系统的开发过程中,有spring负责对象的创 ...

  6. ui组件--弹出层layer的使用

    帮助文档 下载地址 演示地址

  7. TCP UDP 协议的区别和联系

    TCP(Transmission Control Protocol,传输控制协议)是基于连接的协议,也就是说,在正式收发数据前,必须和对方建立可靠的连接.一个TCP连接必须要经过三次“对话”才能建立起 ...

  8. PostgreSQL中COUNT的各条件下(1亿条数据)例子

    test=# insert into tbl_time1 select generate_series(1,100000000),clock_timestamp(),now(); INSERT 0 1 ...

  9. jquery.query.js 插件(示例及简单应用)

    帮助文档 var url = location.search; > "?action=view&section=info&id=123&debug&te ...

  10. 攻城狮在路上(壹) Hibernate(七)--- 通过Hibernate操纵对象(下)

    一.与触发器协同工作: 当Hibernate与数据库的触发器协同工作时,会出现以下两类问题: 1.触发器使Session缓存中的数据和数据库中的不一致: 出现此问题的原因是触发器运行在数据库内,它执行 ...