Why does ant copy old file contents?

350 views Asked by At

I'm having an extremely strange problem with ant. This snippet produces a set of files with the correct names and timestamps, but with obsolete contents.

<target name="inflate-workspace">
    <copy todir="${rns.workspace.dir}" preservelastmodified="true" >
        <fileset dir="${git.dir}/azia" />
        <fileset dir="${git.dir}/scrap-menagerie" />
    </copy>
</target>

The resulting timestamps in toDir correctly match those in the filesets, but the contents of each file is about 2 days old. I activated the verbose flag and manually verified that the source and destination directories are correct. I also manually deleted the toDir and ran the target in isolation, to be sure nothing else weird was happening. Running cp -R ... with the exact same directories works perfect.

The environment is Debian on VBox, hosted in Windows 7. Google turns up nothing related to "ant copy obsolete file contents" or anything like it... anyone heard of such a thing? Please let me know, it's really a bother to have ant copy broken!

3

There are 3 answers

2
Byron Hawkins On BEST ANSWER

The problem here is that ant 1.8.0 was simply broken. I can't imagine why it was ever posted, or why it's still in synaptic for Debian. What a horrible bug... hacky apache.

1
AudioBubble On

Try adding overwrite="true" to your copy command.

0
Jerzy Kiler On

Check for .class files that could be left forgotten and delete them before building next time with ant.