为什么 ant 会复制旧文件内容?
我遇到了一个关于 ant 的非常奇怪的问题。此代码片段生成一组具有正确名称和时间戳的文件,但内容已过时。
<target name="inflate-workspace">
<copy todir="${rns.workspace.dir}" preservelastmodified="true" >
<fileset dir="${git.dir}/azia" />
<fileset dir="${git.dir}/scrap-menagerie" />
</copy>
</target>
toDir
中生成的时间戳与 fileset
中的时间戳正确匹配,但每个文件的内容大约是 2 天前的。我激活了 verbose 标志并手动验证源目录和目标目录是否正确。我还手动删除了 toDir 并单独运行目标,以确保没有发生其他奇怪的情况。使用完全相同的目录运行 cp -R ... 效果非常好。
环境是 Debian on VBox,托管在 Windows 7 中。Google 没有发现任何与“ant 复制过时的文件内容”或类似内容相关的内容...有人听说过这样的事情吗?请告诉我,ant copy
坏了真的很麻烦!
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 fileset
s, 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试将
overwrite="true"
添加到复制命令中。Try adding
overwrite="true"
to your copy command.这里的问题是 ant 1.8.0 根本就被破坏了。我无法想象为什么它会被发布,或者为什么它仍然在 Debian 的 synaptic 中。多么可怕的错误...hacky apache。
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.
检查是否有可能被遗忘的 .class 文件,并在下次使用 ant 构建之前删除它们。
Check for .class files that could be left forgotten and delete them before building next time with ant.