【问题标题】:copying folder from source to destination in build.xml using copydir command使用 copydir 命令在 build.xml 中将文件夹从源复制到目标
【发布时间】:2016-07-17 05:18:49
【问题描述】:

在 ant 构建文件中将目录从源复制到目标时遇到问题。

代码:-

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

错误:-

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

请建议我如何将目录从源复制到目标。我用了几种方法……比如

&lt;export srcUrl="" destPath=""&gt; 这也表示已弃用和使用。但所有属性都不起作用。请建议我怎么做。

【问题讨论】:

    标签: ant build


    【解决方案1】:
    <!-- 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>
    

    您可能还想查看复制任务文档和示例here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-03-31
      • 2021-06-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多