*
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant Path problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant Path problem" Watch "Ant Path problem" New topic
Author

Ant Path problem

Li Xin
Ranch Hand

Joined: Feb 06, 2004
Posts: 37
Hi!

Can anybody tell me in Ant how to copy file from one drive to another? I tried this in my build file but does not work:


<path id="source.java.dir"><pathelement location="C:\project\src"/></path>
<path id="backup.java.dir"><pathelement location="D:\project\backup"/> </path>
<copy todir="${backup.java.dir}">
<fileset dir="${source.java.dir}" ><include name="*.java"/></fileset>
</copy>
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
I'm not really sure what you mean by "[it] does not work". Perhaps you just need to use slashes instead of backslashes in your paths.

The following example seems to work for me.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant Path problem
 
Similar Threads
[junit] java.lang.ClassNotFoundException: UserActivityTest
Where is documentation for ant task schemaexport
Ant: earExport is not working with Jdk 1.4
Problem getting log4j.properties picked up when I use security.manager ?
may be some bugs inside schemaexport ?