The issue seems to be related to copyToLib task. It is always up-to-date in the cases where this fails. Even if I manually delete the output directory. I have not yet figured out why.