Solved

ANT NEWBIE: How to overwrite on copy regardless of timestamp?

Posted on 2006-06-30
4
555 Views
Last Modified: 2012-06-21
Dear Experts,

I'm an Ant dummy...

I have a working Ant that builds my project, and then additionally copies the classes to a remote box.  However, the TIME on the remote box keeps getting ahead of my time.  And it appears that the copy fails whenever that happens.  I can only assume that Ant is comparing the timestamps of the matching files, and not overwriting what it thinks are "later" files.

How can I tell it to overwrite regardless?

This is the Ant snippet;

    <copy todir="\\MyRemoteBox\MyProduct\bin">
     <fileset dir=".\classes"/>

Thanks!
BrianMc1958

0
Comment
Question by:BrianMc1958
  • 3
4 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 250 total points
ID: 17017832
Hi BrianMc1958

You could delete the classes in the remote box befor you attempt to copy them, just use the <delete> task with the <fileset> element.

Cheers
0
 
LVL 35

Expert Comment

by:girionis
ID: 17017839
Have a look here: http://ant.apache.org/manual/CoreTasks/delete.html for more info
0
 

Author Comment

by:BrianMc1958
ID: 17018013
Works!
--BrianMc1958
0
 
LVL 35

Expert Comment

by:girionis
ID: 17019712
:-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
unix in java example 9 52
Java - Why doesn't this JFrame work 3 40
fibonacci ten numbers 4 24
servlet filter example 37 37
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now