diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 2a86da185..bff5714ea 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -72,6 +72,7 @@ Frank Harnack Frederic Lavigne Gary S. Weaver Gautam Guliani +Georges-Etienne Legendre Gero Vermaas Gerrit Riessen Glenn McAllister diff --git a/WHATSNEW b/WHATSNEW index f02e95d93..914a89466 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -175,6 +175,9 @@ Fixed bugs: * Project not set on ChainReaderHelpers used by the Redirector. Bugzilla report 37958. +* Copy task would fail on locked (or otherwise uncopyable) files even if + failonerror set to false. Bugzilla report 38175. + Other changes: -------------- * Minor performance improvements Bugzilla report 37777 diff --git a/src/main/org/apache/tools/ant/taskdefs/Copy.java b/src/main/org/apache/tools/ant/taskdefs/Copy.java index e35cd19b1..4bc0bc4dc 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Copy.java +++ b/src/main/org/apache/tools/ant/taskdefs/Copy.java @@ -799,7 +799,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); } } }