How to copy a directory using Ant How to copy a directory using Ant java java

How to copy a directory using Ant


<copy todir="${dest.dir}" >      <fileset dir="${src.dir}" includes="**"/>  </copy> 

believe that will do what you want... (Recursive copy done)


Copy contents including the directory itself.

<copy todir="${dest.dir}" >      <fileset dir="${src.dir.parent}">          <include name="${src.dir}/**"/>    </fileset></copy>

Note: ${src.dir} is relative to ${src.dir.parent}, and not a full path


You should only have to specify the directory (sans the includes property):

<copy todir="../new/dir">    <fileset dir="src_dir"/></copy>

See the manual for more details and examples.