1

I am facing issue while copying directories from source to destination in ant build file.

code:-

<target name="getResources" depends="init">
    <delete dir="${resources.dir}"/>    
    <copy file="${svn.resources.url}" tofile="${resources.dir} " />
</target> 

Error:-

build.xml:150: Use a resource collection to copy directories.

Please suggest me how to copy directory from source to destination. I used several ways...like

<export srcUrl="" destPath=""> this is also saying deprecated and used and also. but none of the properties are working. Please suggest me how to do.

1 Answer 1

3
<!-- copy one file -->
<copy file="/home/guest/workspace/so/src/build.xml" tofile="/home/guest/workspace/so/src/build2.xml" />

<!-- copy a folder recuresively -->
<copy todir="/home/guest/workspace/so/src2">
    <fileset dir="/home/guest/workspace/so/src" includes="**" />
</copy>

you also may want to look at copy task documentation and examples here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.