---
title: "ant copy"
author: "abalone"
date: "2010-03-12T17:25:47Z"
tags: []
categories: ["编程语言"]
slug: "ant-copy"
draft: false
lastmod: "2010-03-12T17:25:47Z"
id: 614356
url: "https://eric0000.iteye.com/blog/614356"
---

复制一个目录中所有文件，除去含有Test字符的文件
<target name="copyfiles">        
        <copy todir="${dest.dir}" overwrite="true">
           <fileset dir="${src.dir}">
               <include name="**/*.java"/>
             <exclude name="**/*Test*"/>
           </fileset>
        </copy>
</target>

复制一个目录中所有文件，除去含有Test字符的目录
<target name="copyfiles">        
        <copy todir="${dest.dir}" overwrite="true">
           <fileset dir="${src.dir}">
             <exclude name="**/*Test*/**"/>
           </fileset>
        </copy>
</target>