1

如果控制台输出中出现某个字符串,有没有办法让 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 插件感兴趣,要么对为此配置我的工作的本地方式感兴趣

4

1 回答 1

4

这就是您要查找的内容:

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

您可以编辑解析规则文件以包含您想要的任何文本。这应该让您requires exclusive access to the edit lock and hence cannot proceed.在解析文件中将文本用作正则表达式。上面 wiki 页面上的说明非常清楚。

于 2010-11-29T14:19:19.557 回答