Replace ant.delete with apache commons FileUtils.delete and adds retry in case of error.