Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant exec: redirecting standard out but not standard error

Tags:

ant

I have an exec task whose output I am putting into a property using the outputproperty attribute. The command may print some errors to stderr, I do not want the errors to be included in the output (since the output is being fed into another command) but rather to be printed out to the user. So I am redirecting the output and error into separate properties and echo the error property. It seems kind of a hack to have to echo the error. Is it possible to redirect the output of an exec but leave error on stderr or stdout? I assume it means setting the error attribute to some magical value but I cannot figure out what that value is.

like image 993
Konstantin Tarashchanskiy Avatar asked Dec 22 '11 17:12

Konstantin Tarashchanskiy


1 Answers

Try removing error or errorproperty attributes and adding logError="true".

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

like image 82
Vadzim Avatar answered Sep 29 '22 14:09

Vadzim