ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vimil Saju <vimils...@yahoo.com>
Subject Regarding exec task
Date Wed, 08 Feb 2012 04:10:36 GMT
Hi,

I noticed that on windows, if I use the exec task to run a batch script which in turn starts
other processes then if kill ant then the sub-processes created by the batch script still
continues to run. I did some research on google and found that the default java implementation
of Process.destroy does not kill the child processes created by a process on windows. I also
found that there are some third party libraries like jvnet that provide the capability of
killing all processes created by a process on windows. So I thought of somehow extending the
'Execute' class of ant to use the functionality of this 3rd party library, but I find that
its difficult if not impossible to extend this class. I can't find a way to provide my implementation
of Process class that does something different when its destroy method is called. Other core
tasks such as java task directly create an instance of the 'Execute' class which makes it
difficult to globally change how a
 process is destroyed within ant. If anyone can provide some suggestions on how this can be
accomplished I will be very grateful.

 Currently the build scripts of my project uses the exec task to run a bunch of batch scripts
in parallel which in turn execute sql scripts by starting off another process. I have written
the ant script such that if any sql scripts fail then the ant build fails.When the build fails
I notice that all the batch scripts have terminated as expected but the processes spawned
by these batch scripts still continue to run.

Any help is greatly appreciated.

Thanks
Vimil
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message