1

Here I have problem in maven something like that

.....
<tasks>
    <exec executable="subst" failonerror="false">
        <arg line="f: c:\blabla"/>
    </exec>
////// here the execution I try to make!
    <exec executable="subst" failonerror="false" if=//before execution fails!>
        <arg line="g: c:\blabla"/>
    </exec>
<tasks>

I couldnt imagine how to run a command in case of another commands fail.

Thanks for your help

1 Answers1

1

Those are Ant tasks. It only has anything to do with Maven because you're using the Antrun plugin. You should take a look the manual page for the Ant exec task. In particular, you'll probably be interested in the "resultproperty" attribute. That will let you capture the exit code of the process and then you can make decisions based on it.

Ryan Stewart
  • 126,015
  • 21
  • 180
  • 199