ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: "destroy"-ing an Ant exec doesn't destroy what Ant is "exec"-ing...
Date Mon, 07 Apr 2003 08:05:15 GMT
On Mon, 07 Apr 2003, Rich Wagner <> wrote:

> If I hit the "Stop" button while my Ant build file is in the middle
> of "exec"-ing that "build.exe" sub-Process, the "destroy" call
> *DOES* kill Ant, but Ant does not - in turn - "destroy" the
> "build.exe" sub-process.

Ant will try to kill the spawned processes in it's shutdown hook
(given a Java VM recent enough to support shutdown hooks and Ant >=
1.5 that is).

I've found that at least on Unix shutdown hooks will not be called by
the VM if you kill the spawned process with enough violence (i.e. 
kill -9 doesn't, a simple kill usually does).

If Ant's VM has no chance to call the shutdown hooks, there probably
isn't anything you can do.

> Anyway, details aside, is there maybe a different way (other than
> "exec") that I can run "Ant"

Sure.  Look what Main does and clone it (don't use Main directly, its
not suitable for that).

Most Ant IDE integrations do not execute Ant in a separate VM.  You
may be able to get some ideas of the Open Source versions of existing
IDE integrations (NetBeans, Eclipse, the JBuilder AntRunner and
probably others are Open Source).


View raw message