Ant exec: redirecting standard version but not standard error

I have an exec task, the result of which I put in the property using the outputproperty attribute. The command may print some errors in stderr, I do not want the errors to be included in the output (since the output is fed to another command), but rather for printing to the user. Therefore, I redirect the output and error to separate properties and the echo error property. This seems to crack the echo error. Is it possible to redirect the output of exec, but leave the error on stderr or stdout? I suppose this means setting the error attribute to some kind of magic value, but I cannot figure out what that value is.

+8
ant
source share
1 answer

Try removing the error or errorproperty and add logError="true" .

See http://ant.apache.org/manual/Tasks/exec.html

+7
source share

All Articles