【问题标题】:Maven job in Jenkins not showing ERRORs in Console OutputJenkins 中的 Maven 作业未在控制台输出中显示错误
【发布时间】:2013-08-28 17:04:10
【问题描述】:

我使用 Maven 项目插件在 Jenkins 中定义了一个 Maven 作业。当此构建失败并出现错误时(即构建战争文件时缺少 web.xml 或缺少过滤器属性文件),Jenkins 中针对该作业的控制台输出不显示实际的错误日志,这使得调试失败的构建几乎不可能。

这里的其他几个类似问题建议使用 -e 和 -X 选项,但这并不能解决问题。这些选项均已成功启用并显示调试输出,但未显示指示实际失败的 ERROR 日志。

是否需要启用或更改一些额外的 Jenkins 或 Maven 日志记录配置才能使这些错误显示在 Jenkins 的控制台输出中?

这些是我正在使用的版本:

Maven 3.05
詹金斯 1.5.27
Maven 项目插件 1.5.27

mvn 命令:

mvn clean deploy

从命令行运行时得到的输出 - 这是我想看到的:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] base .................................. FAILURE [9.952s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.636s
[INFO] Finished at: Wed Aug 28 11:50:46 CDT 2013
[INFO] Final Memory: 5M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources (default-resources) on project base: Error loading property file '/Applications/eclipse/workspace/base/src/filters/dev/developerOverride/jenna.pederson.properties' -> [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]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :base

我从 Jenkins 运行时得到的输出 - 这没有帮助:

INFO: ------------------------------------------------------------------------
Aug 28, 2013 11:02:36 AM org.apache.maven.cli.event.ExecutionEventLogger logReactorSummary
INFO: Reactor Summary:
Aug 28, 2013 11:02:36 AM org.apache.maven.cli.event.ExecutionEventLogger logReactorSummary
INFO: 
Aug 28, 2013 11:02:36 AM org.apache.maven.cli.event.ExecutionEventLogger logReactorSummary
INFO: base .................................. FAILURE [0.533s]
Aug 28, 2013 11:02:36 AM org.apache.maven.cli.event.ExecutionEventLogger logReactorSummary
INFO: ------------------------------------------------------------------------
Aug 28, 2013 11:02:36 AM org.apache.maven.cli.event.ExecutionEventLogger logResult
INFO: BUILD FAILURE
Aug 28, 2013 11:02:36 AM org.apache.maven.cli.event.ExecutionEventLogger logStats
INFO: ------------------------------------------------------------------------
Aug 28, 2013 11:02:36 AM org.apache.maven.cli.event.ExecutionEventLogger logStats
INFO: Total time: 3.401s
Aug 28, 2013 11:02:36 AM org.apache.maven.cli.event.ExecutionEventLogger logStats
INFO: Finished at: Wed Aug 28 11:02:36 CDT 2013
Aug 28, 2013 11:02:36 AM org.apache.maven.cli.event.ExecutionEventLogger logStats
INFO: Final Memory: 8M/258M
Aug 28, 2013 11:02:36 AM org.apache.maven.cli.event.ExecutionEventLogger sessionEnded
INFO: ------------------------------------------------------------------------
[JENKINS] Archiving /home/jenkins/jobs/0.1.0-b1 - Maven/workspace/base/pom.xml to /home/jenkins/jobs/0.1.0-b1 - Maven/modules/com.base$base/builds/2013-08-28_11-02-30/archive/com.base/base/0.1.0-b1-SNAPSHOT/base-0.1.0-b1-SNAPSHOT.pom
channel stopped
Finished: FAILURE

【问题讨论】:

    标签: java jenkins maven-3


    【解决方案1】:

    这似乎是 core/maven-plugin 中的一个新错误,如下所述:https://groups.google.com/forum/#!msg/jenkinsci-users/kKruFR_k3Ho/ElQAdXs5sG0J

    我已验证它在 Jenkins v1.519 中可以正常工作,但在 1.527、1.529 中无法正常工作。按照建议,将考虑降级到 LTS 版本或等到 1.530。

    【讨论】:

    【解决方案2】:

    我今天也遇到了同样的问题。

    原来占位符 ${version} 之一没有从父 pom 正确传播。

    尝试删除 ~/.m2 中的本地 repo - 然后在本地重新构建项目。希望错误会出现在本地,这将更具描述性。

    我不确定詹金斯为什么会接受这个错误。

    【讨论】:

    • 我了解构建本身失败的原因。这只是如何生成不同 Jenkins/CLI 输出的示例。我实际上是想弄清楚 Jenkins 如何/为什么报告不同的输出。
    【解决方案3】:

    我遇到了同样的问题。

    我在 jenkins 中授予我项目文件夹的权限

    chown -R jenkins:jenkins projectname
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-04
      • 1970-01-01
      • 2017-01-19
      相关资源
      最近更新 更多