about <exec> tag in ant

D

david wolf

I am trying to use <exec> tag in ant to call an native executable. When
I use the command:
"ant dir", I got following errors: (I just want to learn how to use
exec task ). can anyone tell me what happened?

<project>
<target name="dir">
<exec executable ="copy">
<arg value="build.xml"/>
<arg value="build.xml.bbb"/>
</exec>
</target>

</project>

------------errors----------

Complete build sequence is [dir, ]

dir:
[exec] Current OS is Windows XP
[exec] Executing 'copy' with arguments:
[exec] 'build.xml'
[exec] 'build.xml.bbb'
[exec]
[exec] The ' characters around the executable and arguments are
[exec] not part of the command.

BUILD FAILED
C:\jtest\build.xml:3: Execute failed: java.io.IOException:
CreateProcess: copy b
uild.xml build.xml.bbb error=2
at
org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:620)
at
org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:452)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at
org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top