当前位置: 首页 > news >正文

Maven常见异常及解决方法

异常1:

[ERROR] Failed to execute goal on project biz_zhuhai: Could not resolve dependencies for project biz_zhuhai:biz_zhuhai:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [com.maywide.ibh:lib345:pom:1.0 (compile)]: Failed to read artifact descriptor for com.maywide.ibh:lib345:pom:1.0: Could not transfer artifact com.maywide.ibh:lib345:pom:1.0 from/to releases (http://localhost:9888/nexus-2.0.3/content/repositories/releases): Connection to http://localhost:9888 refused: Connection refused: connect -> [Help 1]

解决方法:

这是配置的url有错误或者是私服没有配好,导致构件下载时出错。如果没有jar包需要在私服里下载,可以不配置私服的,也就是可以把setting.xml的profiles里的东西全部删除的。

 

异常2

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project web_nanchang: There are test failures.

[ERROR]

[ERROR] Please refer to E:\maven\web_nanchang\target\surefire-reports for the individual test results.

解决方法:

这是因为测试代码时遇到错误,它会停止编译。只需要在pom.xml的<project>里添加以下配置,使得测试出错不影响项目的编译。

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <testFailureIgnore>true</testFailureIgnore>
            </configuration>
        </plugin>
    </plugins>
</build>

 

异常3:

[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.0.6:start (start-container) on project myproject: Execution start-container of goal org.codehaus.cargo:cargo-maven2-plugin:1.0.6:start failed: Error while expanding C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\cargo\installs\apache-tomcat-6.0.29.zip
[ERROR] java.io.IOException: Negative seek offset
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutio
nException

解决方法:

自己下载“apache-tomcat-6.0.29.zip”,将下载好的文件拷贝到指定文件夹“C:\Documents and Settings\Administrator\Local Settings\Temp\cargo\installs”下。

 

异常4

[ERROR] 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 (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:

解决方法:

maven的web项目默认的webroot是在src\main\webapp。如果在此目录下找不到web.xml就抛出以上的异常。解决方法在pom.xml加入以下的配置。红色字体改成你网站的根目录。

<build>
    <finalName>simple-webapp</finalName>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
                <webResources>
                    <resource>
                        <!-- this is relative to the pom.xml directory -->
                        <directory>WebContent</directory>
                    </resource>
                </webResources>
            </configuration>
        </plugin>
    </plugins>
</build>

相关文章:

  • Linux - Redmine使用方式 | SVN提交代码
  • (转)真正的中国天气api接口xml,json(求加精) ...
  • redis/memcached可视化客户端工具TreeNMS
  • angular下如何绑定form表单的change事件
  • 实现两次点击超过0.5s之后执行某方法(不使用定时器)
  • 百度分页效果之纯jsp版
  • 腾讯云服务器 Centos6.5 安装 nginx1.12.0
  • mysql 基础
  • 关于抵御Petya勒索病毒的最新办法
  • 销售趋势分析折线图
  • How do we build TiDB
  • hbase region split方式
  • ASP.NET MVC5+EF6+EasyUI 后台管理系统(32)-swfupload多文件上传[附源码]
  • hihocoder 1457(后缀自动机+拓扑排序)
  • Gnocchi+Aodh服务简析
  • Android路由框架AnnoRouter:使用Java接口来定义路由跳转
  • Django 博客开发教程 16 - 统计文章阅读量
  • Docker容器管理
  • javascript数组去重/查找/插入/删除
  • JS笔记四:作用域、变量(函数)提升
  • Laravel Telescope:优雅的应用调试工具
  • unity如何实现一个固定宽度的orthagraphic相机
  • vue从创建到完整的饿了么(11)组件的使用(svg图标及watch的简单使用)
  • 回顾 Swift 多平台移植进度 #2
  • 开源地图数据可视化库——mapnik
  • 力扣(LeetCode)357
  • 聊聊directory traversal attack
  • 面试总结JavaScript篇
  • 前端
  • 前端技术周刊 2018-12-10:前端自动化测试
  • 如何将自己的网站分享到QQ空间,微信,微博等等
  • 优化 Vue 项目编译文件大小
  • - 语言经验 - 《c++的高性能内存管理库tcmalloc和jemalloc》
  • MiKTeX could not find the script engine ‘perl.exe‘ which is required to execute ‘latexmk‘.
  • ​flutter 代码混淆
  • ​虚拟化系列介绍(十)
  • # 日期待t_最值得等的SUV奥迪Q9:空间比MPV还大,或搭4.0T,香
  • ###C语言程序设计-----C语言学习(3)#
  • #微信小程序:微信小程序常见的配置传旨
  • (2)(2.4) TerraRanger Tower/Tower EVO(360度)
  • (2)STM32单片机上位机
  • (ctrl.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MDd_DynamicDebug”不匹配值“
  • (Forward) Music Player: From UI Proposal to Code
  • (多级缓存)缓存同步
  • (附源码)spring boot基于Java的电影院售票与管理系统毕业设计 011449
  • (南京观海微电子)——COF介绍
  • (学习日记)2024.01.09
  • (译)2019年前端性能优化清单 — 下篇
  • (转载)虚幻引擎3--【UnrealScript教程】章节一:20.location和rotation
  • ./configure,make,make install的作用
  • .360、.halo勒索病毒的最新威胁:如何恢复您的数据?
  • .bat批处理(八):各种形式的变量%0、%i、%%i、var、%var%、!var!的含义和区别
  • .Net Memory Profiler的使用举例
  • .NET 程序如何获取图片的宽高(框架自带多种方法的不同性能)
  • .NET 同步与异步 之 原子操作和自旋锁(Interlocked、SpinLock)(九)