diff --git a/src/main/org/apache/tools/ant/taskdefs/Copy.java b/src/main/org/apache/tools/ant/taskdefs/Copy.java index 4bc0bc4dc..bb90ac790 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Copy.java +++ b/src/main/org/apache/tools/ant/taskdefs/Copy.java @@ -889,7 +889,10 @@ public class Copy extends Task { if (targetFile.exists() && !targetFile.delete()) { msg += " and I couldn't delete the corrupt " + toFile; } - throw new BuildException(msg, ioe, getLocation()); + if (failonerror) { + throw new BuildException(msg, ioe, getLocation()); + } + log(msg, Project.MSG_ERR); } } }