How do I flush the output of a custom exec task?

I have a custom exec task that takes about 8-12 minutes to run. Once the task is done, the output gets printed out but I want to be able to see the output as its being produced by the application that is being ran. How can I achieve this?

I don’t think the ‘Exec’ task gives you an option to configure that behavior. Instead you might want to create a task action that writes the output via ‘Process.consumeProcessOutput(System.out, System.err)’. Have a look at the Groovy Process Management page for a jumpstart.