Forked java ant tasks cannot be stopped

Hi,

I am not able to stop ant targets that invoke java with fork set to true
]]>
<java classname="com.rbs.ird.utils.Jetty" dir="$" fork="true" />
</target>

When such task is invoked from Ant Build window, a dialog box appears with Cancel and Background buttons. Pressing Cancel button disables it but dialog stays open and the task keeps running. If Background is pressed dialog closes and the task keeps running in the background, however stop button does not stop the task, pressing stop does not do anything.

Regards,

Alex

4 comments

This happens with IDEA 6.0.4, windows xp professional, and bundled ant 1.6.5

0

Hello Alex,

Cancel and Background options are common for all ant builds. You can set
Background ON before start, in ant file properties dialog (invoked from Ant
Build window).

I tried a fake script imitating the structure of yours:
]]>
<java classpath="garb07-ant.jar" classname="fork.MyPlane" dir="$" fork="true" /> </target> </project> Class fork.MyPlane just makes a System.out.println("someting"). It runs and completes successfully. Can your case be a loop in Jetty class, or anything else specific? Does it runs Ok outside IDEA? > Hi, > > I am not able to stop ant targets that invoke java with fork set to > true > <target name="start.jetty" depends="web-app"> > <java classname="com.rbs.ird.utils.Jetty" dir="$"

fork="true" />
</target>
When such task is invoked from Ant Build window, a dialog box appears
with Cancel and Background buttons. Pressing Cancel button disables it
but dialog stays open and the task keeps running. If Background is
pressed dialog closes and the task keeps running in the background,
however stop button does not stop the task, pressing stop does not do
anything.

Regards,

Alex

Alexander.


0

This problem happens with processes that do not complete but keep running as a server. In my case I have a task start.jetty that starts jetty web server, that I want to keep running. The problem is that once it is running there is no way to stop it.
You can reproduce a problem by making MyPlane to sleep indefinitely. Surely stop button should kill such task?

If I run the ant task from command prompt everything works as expected.
ant start.jetty starts the server, and CTRL-C interrupts the task.

My problem is that a running task cannot be stopped/killed from intellij ant runner, neither when it runs in the background nor foreground.

I am also pretty sure that it used to work a few versions back.

0

Hello Alex,

Thanks, got it. Yes, the issue exists. This is the same problem as http://www.jetbrains.net/jira/browse/IDEABKL-4379.
The issue is that killing a tree of processes (started by Ant) is not pure
java task. We need to povide special scripts for every operation system.
At the moment this is not yet planned for current IDEA version.

This problem happens with processes that do not complete but keep
running as a server. In my case I have a task start.jetty that starts
jetty web server, that I want to keep running. The problem is that
once it is running there is no way to stop it.

You can reproduce a problem by making MyPlane to sleep indefinitely.
Surely stop button should kill such task?

If I run the ant task from command prompt everything works as
expected. ant start.jetty starts the server, and CTRL-C interrupts the
task.

My problem is that a running task cannot be stopped/killed from
intellij ant runner, neither when it runs in the background nor
foreground.

I am also pretty sure that it used to work a few versions back.

Alexander.


0

Please sign in to leave a comment.