• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

moving files via ant

 
Ranadhir Nag
Ranch Hand
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try adding the "flatten" attribute to the copy task.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic