Gradle Copy Task: How to overwrite existing files?

user1329572 picture user1329572 · Sep 7, 2012 · Viewed 24.6k times · Source

The Copy api doesn't mention a flag/property that can be set. So what's the default action and how can one modify it?


According to this,

As of Gradle 0.9.1, the Copy task always overwrites files. The other strategies are not supported yet.

Answer

Peter Niederwieser picture Peter Niederwieser · Sep 7, 2012

As the issue text says, the Copy task overwrites files, and other strategies aren't currently supported. If that's not appropriate in your case, you can always fall back to the Ant task.