How can I redirect ant exec task output to both a

2019-04-18 06:31发布

问题:

I am using the ant (1.8.2) exec task to start a child process. I need the output of the child process to be shown as part of the normal ant console output, but also be captured in a file.

回答1:

You need the redirector

Since Ant 1.6.3 it has an option called alwayslog.

Use it like this:

<exec executable="mycommand">
   <redirector output="myfile.txt" alwayslog="true"/>           
</exec>


标签: ant