Ant is not able to delete some files on windows

后端 未结 14 2411
我寻月下人不归
我寻月下人不归 2021-02-07 01:36

I have an ant build that makes directories, calls javac and all the regular stuff. The issue I am having is that when I try to do a clean (delete all the stuff that was generate

相关标签:
14条回答
  • 2021-02-07 02:06

    Using Ant Retry task has helped me. I've just wrapped it around the Delete Task.

    0 讨论(0)
  • 2021-02-07 02:06

    In my case, I stopped running Java process from Task Manager and re-run the Ant build file. The file was able to delete and build was successful.

    0 讨论(0)
  • 2021-02-07 02:11

    In my case my ant clean was failing from Eclipse, unable to remove build files. I see this from time to time. Usually succeeds on a repeat attempt. This time no. Tried running ant clean from command line, failed Unable to delete"unable to delete". It must have been Eclipse holding on to the problem file, when I exited Eclipse, cmd line was able to delete OK.

    0 讨论(0)
  • 2021-02-07 02:11

    I am seeing problems like this way too often since I switched to Microsoft Windows 10. Renaming the file immediately before removing it solved it for me:

    <rename src="file.name" dest="file.name.old"/>
    <delete file="file.name.old" />
    
    0 讨论(0)
  • 2021-02-07 02:12

    Ant versions before 1.8.0 have a bug which leads to random errors during delete operation. Try using Ant 1.8.0 or newer.

    You can see the bug details here https://issues.apache.org/bugzilla/show_bug.cgi?id=45960

    0 讨论(0)
  • 2021-02-07 02:19

    I encountered this problem once. It was because the file i tried to delete was a part of a classpath for another task.

    0 讨论(0)
提交回复
热议问题