ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Rousse <>
Subject using timeout in exec command of ant
Date Tue, 15 Oct 2002 13:05:25 GMT
 Hi all,

I am working on Windows 2K platform with jdk 1.3.1 and ant 1.5. I would 
like to
use the timeout option of the exec command.

I set the timeout to 1000 (one second). But the task continues after 
timeout has been reached until it finishes.

xml file is:

<project name="xxxxx" default="all" basedir=".">

    	<target name="Batch">
		<exec dir ="c:/temp" executable="c:/home/cmd/save.bat" os="Windows 2000" 
output="Batch.lst" append="false" timeout="1000">
		  <env key="BATCH" value="BT1AAA"/>
		  <env key="APPPATH" value="C:/Tomcat-4.0.4/webapps/exploitation"/>

I am using this main program to start the task: (run method of a thread)

  public void run() {

            String dir = "c:/temp";
            String buildxml = dir + File.separator + "run.xml";

            String[] args
            = new String[] {"-buildfile", buildxml,  "Batch"};
            Main.start(args, null, null);


The output I am getting is the following:

C:\Documents and Settings\srousse\jbproject\essaiEnvp\classes>set 
CLASSPATH=C:\Documents and 

C:\Documents and Settings\srousse\jbproject\essaiEnvp\classes>java 
Buildfile: c:\temp\run.xml

     [exec] Timeout: killed the sub-process
     [exec] Result: 1

Total time: 18 seconds

What could be the cause of that problem ?

In advance thanks.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message