You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ja...@Deio.net on 2002/08/27 20:20:02 UTC

How to kill a task started from ant?

Hi all,

I need (would like to) to start JBoss in from my build file, and then kill 
it so that the rest of build file can be performed. Follows snippet of the 
build file where I start the JBoss and
in parallel (with some delay) I start other application.

...
<parallel>
      <echo message="Starting JBoss."/>
      <exec dir="${project.jbosshome.dir}\bin" 
executable="${project.jbosshome.dir}\bin\run.bat" timeout="150000"/>
 
      <sequential>
        <echo message="Wating for JBoss to start."/>
        <sleep seconds="50"/>
        <echo message="Starting XSLTCreator."/>
        <exec dir="${xsltCreator.dir}" 
executable="${xsltCreator.dir}\run.bat"> 
          <arg line="e:\temp\xslt" />
        </exec> 
      </sequential>
    </parallel>
...

The problem is that the tasks which are after this are never executed, 
since the JBoss never quits. Is there any way out? I could run them in yet 
another thread but I am not sure that that's the right way to do it.

Br,

Jakub

Re: How to kill a task started from ant?

Posted by Jacob Kjome <ho...@visi.com>.
I think that is what the fork attribute is for.  It runs the task in 
another JVM so it shouldn't hold up Ant in the current JVM.

<exec ..... fork="true" >

Jake

At 09:20 PM 8/27/2002 +0300, you wrote:
>Hi all,
>
>I need (would like to) to start JBoss in from my build file, and then kill
>it so that the rest of build file can be performed. Follows snippet of the
>build file where I start the JBoss and
>in parallel (with some delay) I start other application.
>
>...
><parallel>
>       <echo message="Starting JBoss."/>
>       <exec dir="${project.jbosshome.dir}\bin"
>executable="${project.jbosshome.dir}\bin\run.bat" timeout="150000"/>
>
>       <sequential>
>         <echo message="Wating for JBoss to start."/>
>         <sleep seconds="50"/>
>         <echo message="Starting XSLTCreator."/>
>         <exec dir="${xsltCreator.dir}"
>executable="${xsltCreator.dir}\run.bat">
>           <arg line="e:\temp\xslt" />
>         </exec>
>       </sequential>
>     </parallel>
>...
>
>The problem is that the tasks which are after this are never executed,
>since the JBoss never quits. Is there any way out? I could run them in yet
>another thread but I am not sure that that's the right way to do it.
>
>Br,
>
>Jakub