The problem is that an empty zip task is ever UP-TO-DATE. There is no option to add the files on run first. There must be added a modified file in the configuration phase.
This produce multiple problems: * it is not possible to create an empty zip file * an old zip will not deleted if the input is empty. * add files dynamically is not possible
In my case I have downloaded the files from an external web server. First after the download I know which files need to added to the zip file. The download can not run in the configuration phase. It required the output of other tasks.
My workaround in the meantime is to call execute on a inner zip task. There are also other workarounds possible. But it will not change that the behavior is a bug. The major problem is that the old zip file will not deleted if the input is empty.
But was I does not understand why I can not override the upToDateWhen.