简体   繁体   English

Jenkins中的Maven作业未在控制台输出中显示错误

[英]Maven job in Jenkins not showing ERRORs in Console Output

I have a Maven job defined in Jenkins using the Maven Project Plugin. 我有一个使用Maven项目插件在Jenkins中定义的Maven作业。 When this build fails with an error (ie missing the web.xml when building a war file or missing a filter properties file), the Console Output in Jenkins for the job does not show the actual ERROR log and this is making debugging failed builds nearly impossible. 如果此构建因错误而失败(例如,构建war文件时缺少web.xml或缺少过滤器属性文件),则该作业的Jenkins中的Console Output不会显示实际的ERROR日志,这使调试失败的构建几乎不可能。

Several other similar questions on here suggest using the -e and -X options, but that is not solving the problem. 关于此处的其他几个类似问题,建议使用-e和-X选项,但这不能解决问题。 These options are both enabled successfully and debug output is shown, but not the ERROR logs indicating the actual failures. 这些选项都已成功启用,并且显示了调试输出,但未显示指示实际故障的错误日志。

Is there some additional Jenkins or Maven logging configuration that I need to enable or change to make these ERRORs show up in the Console Output of Jenkins? 我需要启用或更改一些其他的Jenkins或Maven日志记录配置,以使这些错误显示在Jenkins的控制台输出中吗?

These are the versions I am using: 这些是我正在使用的版本:

Maven 3.05 Maven的3.05
Jenkins 1.5.27 詹金斯1.5.27
Maven Project Plugin 1.5.27 Maven项目插件1.5.27

The mvn command: mvn命令:

mvn clean deploy

The output I get when running from the command line - this is what I want to see: 从命令行运行时得到的输出-这是我想看到的:

[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

The output I get when running from Jenkins - this is not helpful: 从詹金斯运行时得到的输出-这没有帮助:

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

This appears to be a new bug in the core/maven-plugin as reported here: https://groups.google.com/forum/#!msg/jenkinsci-users/kKruFR_k3Ho/ElQAdXs5sG0J 如此处报告的那样,这似乎是core / maven-plugin中的一个新错误: https ://groups.google.com/forum/#!msg/jenkinsci-users/kKruFR_k3Ho/ElQAdXs5sG0J

I have verified it works correctly in Jenkins v1.519 and does not work in 1.527, 1.529. 我已经验证它在Jenkins v1.519中可以正常工作,并且在1.527、1.529中不起作用。 As suggested, will consider downgrading to an LTS version or waiting til 1.530. 根据建议,将考虑降级到LTS版本或等待到1.530。

I had the same issue today. 我今天有同样的问题。

It turned out one of the placeholder ${version} was not propagating correctly from a parent pom. 原来,占位符$ {version}之一没有从父pom正确传播。

Try to remove your local repo in ~/.m2 - then rebuild the project again locally. 尝试删除〜/ .m2中的本地存储库-然后在本地重新构建项目。 Hopefully the error will appear locally, which will be more descriptive. 希望该错误将出现在本地,这将更具描述性。

I am not sure why Jenkins swallowed this error. 我不确定詹金斯为什么吞下了这个错误。

I had the same issue. 我遇到过同样的问题。

i give permission to my project folder in jenkins 我授予我在jenkins中的项目文件夹的权限

chown -R jenkins:jenkins projectname

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM