2
votes

I have added task to build.xml to check certain condition for deployment e.g require os version and fail if requirements are not meet . e. g

<fail message="Required OS: '${deploy.require_os_version}' does not match with: '${remote_os}'"/>

Which is working but this outputs the whole error stack. Is there better way to send build failure signal and exit with decent error message ?

1
have you got a parse xsl ? then xsltproc parse.xsl stackoverflow.com/questions/11709160/… - Pogrindis
no I don't have that. It seems this is open bug e.g stackoverflow.com/questions/25663869/… - sakhunzai

1 Answers

2
votes

I had the same question. I think the only solution is to nest your tasks in an if/then/else to ensure the failure condition leads to an <echo> and then make sure you have no tasks defined after the if block.

When you think about it, this is perhaps more programmatically correct than using a task to force an early exit under expected conditions.