Ant can't expand the *
wildcard. You need to copy each sub folder on it's own:
<exec executable="cp">
<arg line="-pr env/sub1 ." />
</exec>
<exec executable="cp">
<arg line="-pr env/sub2 ." />
</exec>
..
or if this is unsufficient you may spawn a bash:
<exec executable="bash">
<arg line="-c 'cp -pr env/* .'" />
</exec>
but the latter will work only on systems which having bash installed.
Also have a look at rsync
instead of cp
. Might be better because it can cleanup older files. However using tools like bash
and rsync
will make your script bound to *NIX systems.