ant error Unable to rename old file to temporary file
So I found the answer, after some experimentation. By adding fork="true"
to my javac
task, the file handle is closed at the end of the task. This allows my jar modification to succeed later in the build.
It's unfortunate though, because I have to remember to add this to every upstream javac task.
This is a windows locking issue. Any process/thread reading the file will prevent it from being renamed, which is what the zip task is doing, when updating an existing jar file.
I'm guessing that the file handle is being kept open because your using a classpath reference. Maybe the file handles might be closed if you were to explicitly set the javac task's classpath?