MAVEN SUREFIRE PLUGIN错误

3

我正在为Jenkins构建一个自定义的Maven项目。在使用以下命令后:

   mvn -Plight-test install

我收到了这个错误信息,请帮忙。我已经在pom.xml文件中添加了surefire异常插件,但它没有起作用!错误日志如下:
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO]
    [INFO] Jenkins main module ................................ SUCCESS [ 11.809 s]
    [INFO] Jenkins cli ........................................ SUCCESS [ 38.319 s]
    [INFO] Jenkins core ....................................... FAILURE [11:15 min]
    [INFO] Jenkins war ........................................ SKIPPED
    [INFO] Tests for Jenkins core ............................. SKIPPED
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 12:10 min
    [INFO] Finished at: 2016-05-05T12:26:54+05:30
    [INFO] Final Memory: 39M/277M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project jenkins-core:
    .
    [ERROR]
    [ERROR] Please refer to C:\Users\Anishas\git\jenkins\core\target\surefire-reports for the individual test results.
    [ERROR] -> [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/MojoFailureException
    [ERROR]
    [ERROR] After correcting the problems, you can resume the build with the command
    [ERROR]   mvn <goals> -rf :jenkins-core

enter image description here

编译: 在此输入图片描述

重新运行Maven,使用-X开关以启用完整的调试日志记录。 - Lee
@Lee谢谢你的建议。但是当输出太大时,我该如何识别缺陷? - Learner
从您发布的内容中,除了失败出现在jenkins-core中之外,无法看到更多细节。使用-X参数运行并手动深入适当的领域。如果您运行mvn -rf jenkins-core -X,将从故障点重新启动构建。 - Lee
在执行其他操作之前,您应该先修复所有这些警告和错误... - khmarbaise
3个回答

3
我遇到过相同的问题,发现问题是由于一些测试尝试创建系统链接,但由于我在Windows中未以管理员身份启动我的IDE(IntellijIdea)而无法成功。我以管理员身份启动Intellij并解决了该问题。
在开发过程中跳过测试不是一个好习惯。

经过几天的研究,我终于找到了问题所在。 - kupaff

2
mvn -Dmaven.test.skip=true -DskipTests=true clean install

使用这个命令


1
这是错误的!你不应该跳过测试来修复东西。 - Perimosh
跳过测试并不能解决问题。 - Othello .net dev

1

重新运行 mvn -Plight-test install -rf jenkins-core -X 来隔离错误。


[错误] [错误] 找不到要从中恢复反应堆构建的项目:jenkins-core vs [MavenProject: org.jenkins-ci.main:pom:2.2- - Learner
你的项目结构是如何组织的?你有一个父级 pom.xml 文件吗?还是只是一组同级文件?我认为你有一个指向名为 jenkins-core 的项目的引用,但该项目并不存在。 - Lee
兄弟姐妹的集合 - Learner
如果您只尝试构建 mvn clean compile -pl jenkins-core,输出是什么? - Lee
让我们在聊天中继续这个讨论 - Learner
显示剩余2条评论

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接