ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Art Blake" <art.bl...@mindspring.com>
Subject can't figure out how to start process without Ant blocking
Date Thu, 04 Oct 2001 18:22:05 GMT
I'm trying to write a simple Ant (Ant 1.4, Windows 2000) target to reset
(stop and start) Tomcat, but I cannot figure out how to start an external
process asynchronously.

The exec task seems to block until whatever task is executing completes,
even if the external
process starts its own independant process and then exits.

I've tried to get around this as many ways as I could think of, but Ant
still blocks:


  <!-- Deploy for local tomcat server -->

  <target name="deploy" depends="setup">
    <!-- stop tomcat and copy new war over -->

    <exec dir="${env.TOMCAT_HOME}/bin" executable="shutdown.bat"
vmlauncher="false"/>

    <!--
    ...
    copy files over
    ...
    -->

    <!-- the following task works,
         but Ant blocks, even though the batch file starts its own process
         and then exits immediately -->

    <exec dir="${env.TOMCAT_HOME}/bin" executable="startup.bat"
vmlauncher="false"/>

    <echo message="deployed"/>
  </target>



I tried starting the external process several different ways, but every
single way I try
continues to block.

for example:

    <exec dir="${env.TOMCAT_HOME}/bin" executable="cmd.exe">
      <arg line="/c startup.bat"/>
    </exec>

and

    <exec dir="${env.TOMCAT_HOME}/bin" executable="cmd.exe">
      <arg line="/c start startup.bat"/>
    </exec>

also block!


any ideas?

Thanks


Mime
View raw message