Ant exec: redirecting standard out but not standar

2019-06-17 00:53发布

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.

标签: ant
1条回答
在下西门庆
2楼-- · 2019-06-17 01:18

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

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

查看更多
登录 后发表回答