ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <>
Subject Re: exec command deprecated since Ant 1.2 but recommended in Ant 1.5?
Date Sun, 25 Aug 2002 01:26:03 GMT
Amar Rama wrote:
> Hi,
>    I am looking for some answers around the usage of the  <exec> command 
> and would be grateful for any assistance :-).

The <exec> task is not deprecated
The Exec class is deprecated
<exec> is no longer implemented by the Exec class but is now implemented by 

> According to the javadoc in the source code of the exec command 
> (reproduced below), this command has been deprecated since Ant 1.2 and 
> the use of the Execute command is suggested instead.


>    The execute command though just extends java.lang.Object and not 

Execute is not a task. It is "service" provided by Ant's core for tasks that 
wish to execute external commands. ExecTask is one such task.

> So, I am not sure I follow how I should use 
> it in my build.xml 

You don't.

> (preliminary searches did not yield any results). I 
> tried using the exec command and it works but I need to extend it to add 
> minor custom functionality and I rather not extend a deprecated class.

Look at ExecTask.

>    The FAQ on the home page for "How do I execute a batch file or shell 
> script from ant?" 
> ( still 
> recommends using the <exec> command. 

This is correct.

> Since this is the most recent FAQ, 
> I am interpreting this as meaning, use the exec command for Ant 1.5. 
> This seems slightly contradictory to the comment in the code.
>    Can anybody suggest the right direction to take.

You have made an assumption (<exec> == Exec class) which is incorrect.


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

View raw message