You can use an ant "Selector".  Try something like this:

  <target name="copy-them" depends="init">
    <copy todir="${build}">
      <fileset dir="${src}">
        <include name="**/*.xml"/>
        <present present="srconly" targetdir="${build}"/>
      </fileset>
    </copy>
  </target>

Take a look at:  http://ant.apache.org/manual/CoreTypes/selectors.html


> -----Original Message-----
> From: Ryan Owens [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 17, 2004 10:54 AM
> To: Maven Users List
> Subject: Copy without overwriting.
> 
> Hello all.
> I need to copy a set of files to a directory, but not overwrite a file
> if it exists.
> In other words I only want to copy files that have not been previously
> copied.
> 
> this is what I have in my maven goal now:
> 
>    <copy todir="${maven.src.dir}/java" overwrite="false">
>              <fileset dir="${mydir.dest}/java">
>                  <include name="**/*.java" />
>              </fileset>
>    </copy>
> 
> The ant copy task's 'overwrite' attribute only prevents a copy if the
> destination file is newer, so this snippet doesn't work.
> I need to prevent a copy if the destination file exists at all.
> This may be more of an ant question but I've scoured all the ant
> resources I can find and I'm thinking I need to use jelly or something.
> Is there a better way to copy in Maven than using the ant copy task?
> 
> Thanks for your time and help!
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to