如果控制台输出中出现某个字符串,如何使Hudson作业失败

时间:2010-11-26 13:31:10

标签: hudson hudson-plugins

如果控制台输出中出现某个字符串,有没有办法使hudson作业失败?

我问的原因是因为我们有一些部署EAR文件的作业(通过mvn命令),即使作业成功运行,我也会看到这样的字符串:

<26-Nov-2010 14:05:32 o'clock CET> <Info> <J2EE Deployment SPI> <BEA-260121> 
<Initiating undeploy operation for application, legacyservice [archive: null], 
to cde-server-c01 .>

[Deployer:149163]The domain edit lock is owned by another session in non-exclusive 
mode - this deployment operation requires exclusive access to the edit lock 
and hence cannot proceed.
ExitException: status 1
[INFO] Ignore exit
[INFO] Weblogic un-deployment successful 

我试过摆弄maven命令,但它并没有真正失败。所以我想知道,如果有另一种方法可以发现这个缺陷而失败了。

如果出现这样的字符串,我想失败了。

requires exclusive access to the edit lock and hence cannot proceed.

我要么对能够做到这一点的hudson插件感兴趣,要么以本机方式配置我的工作

1 个答案:

答案 0 :(得分:4)

这就是你要找的东西:

http://wiki.hudson-ci.org/display/HUDSON/Log+Parser+Plugin

您可以编辑解析规则文件以包含所需的任何文本。这应该允许您在解析文件中使用文本requires exclusive access to the edit lock and hence cannot proceed.作为正则表达式。上面维基页面上的说明非常清楚。