ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Hudak <>
Subject Fire and forget exec task
Date Tue, 27 Nov 2001 19:01:58 GMT

I'm new to the list and I wasn't getting any feedback from the users-list so
I'm hoping I can get some feedback here.

In our developement environment, we are creating custom scripts to
automatically deploy new builds to our application servers. This requires us
to first stop the server(s), deploy the new web app and then restart the
server. The exec task works fine for stopping the server but, as I'm sure
you know, doesn't work for starting the server as the process spawned by the
exec task doesn't finish and the Ant build hangs.

I'm wondering if anyone else has encountered a need for the ability to 'fire
and forget' an executable during a build or deploy process?

FWIW, I've hacked the exec task to allow a new attribute 'waitFor' that
allows you to control whether the task waits for the spawned process to
finish. This value is passed to the Execute object that is created which
then either waits for the process to finish and returns the actual exit code
or simply returns 0 and allows Ant to continue.

I encountered one problem, however, in the PumpStreamHandler's stop()
method. This method join()'s the I/O stream threads (actually, handlers,
thereof) of the process which still causes Ant to hang. A workaround is to
pass a timeout value to join() so that it doesn't wait forever. This all
seems to work. I'm curious if anyone sees any issues in having join()
timeout after, say, 500-1000 ms?

In any event, I'm open for other suggestions on how to craft a solution to
this problem so I don't have to do a custom build of Ant to distribute to
our development team. Is there any possiblity that these changes might be
included in future builds?


Charles Hudak
Software Engineer
YouZoom, Inc.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message