Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect stdout stderr in an ant script?

I am triggering an ant script (via cruise control), and would like to be able to dump the std out and std err for a particular ant target to a plain text file.

Yes, I am aware that cruise control already does maintain an XML log file containing this information (among many other things), but for portability reasons, I need this to happen from the ant script itself.

Is this possible, and if so, how to do it?

Many thanks!

like image 560
bguiz Avatar asked Nov 12 '09 01:11

bguiz


1 Answers

It's easy:

ant -logfile <logfile> <command>

And you can also say to ant shut up:

ant -q <command>

It worked fine to me.

like image 59
Felipe Avatar answered Oct 12 '22 15:10

Felipe