如何检测Eclipse构建是否失败?

时间:2022-05-27 07:20:13

Following on from this question, I now want to know how to stop an ANT script from executing if the preceding build failed. I can't see a way in the Build setup in Eclipse of chaining builds together based on their success.

继这个问题之后,我现在想知道如果前面的构建失败,如何阻止ANT脚本执行。我无法在Eclipse的Build设置中看到基于成功链接构建的方法。

I think I am lookikng for either a way to pass the previous build status into my ANT script so I can terminate or to never call the ANT script at all if the first build fails.

我想我可以将上一个构建状态传递到我的ANT脚本中,这样我就可以终止或者在第一次构建失败时根本不调用ANT脚本。

Any ideas?

2 个解决方案

#1


1  

No native way, AFAIK. What you can do is modify your ant script to check if .class files produced by Eclipse are newer than WAR. If not, stop.

没有本土方式,AFAIK。您可以做的是修改您的ant脚本以检查Eclipse生成的.class文件是否比WAR更新。如果没有,停止。

#2


0  

You should be able to store the success into a file. If you make sure the content of the file is a property file content the next ant task can use that file to fill in a property (like build.success) and can act on that.

您应该能够将成功存储到文件中。如果确保文件的内容是属性文件内容,则下一个ant任务可以使用该文件来填充属性(如build.success)并可以对其执行操作。

#1


1  

No native way, AFAIK. What you can do is modify your ant script to check if .class files produced by Eclipse are newer than WAR. If not, stop.

没有本土方式,AFAIK。您可以做的是修改您的ant脚本以检查Eclipse生成的.class文件是否比WAR更新。如果没有,停止。

#2


0  

You should be able to store the success into a file. If you make sure the content of the file is a property file content the next ant task can use that file to fill in a property (like build.success) and can act on that.

您应该能够将成功存储到文件中。如果确保文件的内容是属性文件内容,则下一个ant任务可以使用该文件来填充属性(如build.success)并可以对其执行操作。