This is an automated email from the ASF dual-hosted git repository.

slawekjaranowski pushed a commit to branch maven-filtering-3.x
in repository https://gitbox.apache.org/repos/asf/maven-filtering.git


The following commit(s) were added to refs/heads/maven-filtering-3.x by this 
push:
     new 2107ec4  Improve error message for MalformedInputException during 
resource filtering (#328)
2107ec4 is described below

commit 2107ec4fefe7fa1f9628abe9fdabf7ee156150f0
Author: LBS <[email protected]>
AuthorDate: Sat Jun 13 02:49:53 2026 +0800

    Improve error message for MalformedInputException during resource filtering 
(#328)
---
 src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java 
b/src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java
index 74be18a..196b570 100644
--- a/src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java
+++ b/src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java
@@ -24,6 +24,7 @@ import java.io.OutputStream;
 import java.io.Reader;
 import java.io.Writer;
 import java.nio.charset.Charset;
+import java.nio.charset.MalformedInputException;
 import java.nio.file.FileSystemException;
 import java.nio.file.Files;
 import java.nio.file.NoSuchFileException;
@@ -388,6 +389,8 @@ public final class FilteringUtils {
                         writer.write(buffer, 0, nRead);
                     }
                 }
+            } catch (MalformedInputException e) {
+                throw new IOException(e.getMessage() + " - using encoding " + 
charset.name(), e);
             }
         }
         copyFilePermissions(from, to);
@@ -418,6 +421,8 @@ public final class FilteringUtils {
                     }
                     copied = writer.isModified();
                 }
+            } catch (MalformedInputException e) {
+                throw new IOException(e.getMessage() + " - using encoding " + 
charset.name(), e);
             }
         }
         copyFilePermissions(from, to);

Reply via email to