How to get Ant ignore error from one target?

I have a goal consisting of several steps that sometimes fail. This whole goal is a Sonar report, so if it fails, it is not catastrophic. How to get the assembly to succeed, even if this specific goal failed?

I tried some combinations of "condition", "or", "true" and "serial", but Ant did not like any of them.

Below I get more or less:

<target name='sonar'> <!-- do some stuff --> <sonar:sonar key='key' version='version'/> </target> 
+4
source share
1 answer

The only way I can see this is to use the slightly obsolete but still useful antcontrib extension. Then you can use the try / catch directive and just repeat your mistake. http://ant-contrib.sourceforge.net/tasks/tasks/trycatch.html

+1
source

All Articles