Try invoking with -d and ant will show you exactly the command line it is
running. This may reveal your issue.

In this particular case you might want to consider using the <ant> task
instead of exec.

<project name="test" default="run">
>
>     <target name="run">
>        <ant antfile="${ant.file}" target="clean"/>
>     </target>
>
>     <target name="clean">
>        <echo message="CLEAN"/>
>     </target>
>
> </project>
>

Harold

On Tue, Apr 10, 2012 at 2:54 AM, Jarek Czekalski
<jarekc...@poczta.onet.pl>wrote:

> On 1.8.2 and same windows it runs fine.
>
> W dniu 2012-04-09 16:54, ivadim pisze:
>
>  Hello.
>> I have some problems with exec task.
>>
>> I have build.xml:
>> <project name="test">
>>
>>     <target name="run">
>>        <exec executable="cmd">
>>                <arg value="/c"/>
>>                <arg value="${ant.home}/bin/ant"/>
>>                <arg value="-f"/>
>>                <arg value="${ant.file}"/>
>>                <arg value="clean"/>
>>        </exec>
>>     </target>
>>
>>     <target name="clean">
>>        <echo message="CLEAN"/>
>>     </target>
>>
>> </project>
>>
>> When I run "ant run" command I expected to see CLEAN message. But actualy
>> this is recursively execute task "run".
>>
>> run:
>>      [exec] Buildfile: C:\Users\dmivanov\Projects\**tmp\build.xml
>>      [exec]
>>      [exec] run:
>>      [exec]      [exec] Buildfile: C:\Users\dmivanov\Projects\**
>> tmp\build.xml
>>      [exec]      [exec]
>>      [exec]      [exec] run:
>>
>> My OS is Windows 7x64
>> Ant version is 1.8.0
>>
>> Anybody know why it is happens?
>>
>>
>> --
>> View this message in context: http://ant.1045680.n5.nabble.**
>> com/Problems-with-exec-task-**on-Windows-machine-**tp5627489p5627489.html<http://ant.1045680.n5.nabble.com/Problems-with-exec-task-on-Windows-machine-tp5627489p5627489.html>
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: 
>> user-unsubscribe@ant.apache.**org<user-unsubscr...@ant.apache.org>
>> For additional commands, e-mail: user-h...@ant.apache.org
>>
>>
>>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> user-unsubscribe@ant.apache.**org<user-unsubscr...@ant.apache.org>
> For additional commands, e-mail: user-h...@ant.apache.org
>
>


-- 
Harold PUTMAN
Web Technology Specialist
*Lexmark International, Inc. <http://www.lexmark.com>*
740 W New Circle Rd.
Lexington, KY 40550
+1(859) 232-2839
hput...@lexmark.com

Reply via email to