This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes moving files via ant 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 "moving files via ant" Watch "moving files via ant" New topic
Author

moving files via ant

Ranadhir Nag
Ranch Hand

Joined: Mar 09, 2006
Posts: 138
i have a war hidden at a sublevel with a directory 'Axx'(C:\Axx\output\classes\lib\*.war).
This needs to need to be copied over to the root loaction of dir 'Bxx'.

If I write a ant move task as:
<move todir="${deploy_dir}">
<fileset dir="${output_dir}">
<include name="**/*.war"/>
</fileset>
</move>
This would copy over but maintain the directory structure rather than put in under C:\Bxx.
I can do a hard-coding of the full path;but i would rather avoid that.

Is there some way possible to achive this 'move' without resorting to hard-coding of the entire path to the file?

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Try adding the "flatten" attribute to the copy task.


JBoss In Action
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: moving files via ant
 
Similar Threads
ANT Complilation Issue
Including a jar within a jar
Question on Ant script error in my build.xml file in the Eclipse IDE
J2EE Deployment using ANT
WAR error - Unexpected element "{}war"