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

elharo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-invoker-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 39d6844  Specify UTF-8 when reading build log (#267)
39d6844 is described below

commit 39d684424a4a59618be26ecdd5cbd689cb2e04b5
Author: Elliotte Rusty Harold <elh...@users.noreply.github.com>
AuthorDate: Sat Dec 7 18:19:01 2024 +0000

    Specify UTF-8 when reading build log (#267)
    
    * SpecifyUTF-8 when reading build log
---
 src/main/java/org/apache/maven/plugins/invoker/InvokerSession.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/invoker/InvokerSession.java 
b/src/main/java/org/apache/maven/plugins/invoker/InvokerSession.java
index a666744..ba2635e 100644
--- a/src/main/java/org/apache/maven/plugins/invoker/InvokerSession.java
+++ b/src/main/java/org/apache/maven/plugins/invoker/InvokerSession.java
@@ -19,8 +19,9 @@
 package org.apache.maven.plugins.invoker;
 
 import java.io.File;
-import java.io.FileReader;
 import java.io.IOException;
+import java.io.Reader;
+import java.nio.file.Files;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -210,7 +211,7 @@ class InvokerSession {
                     buildLogMessage.append(System.lineSeparator());
                     buildLogMessage.append("*** begin build.log for: " + 
buildJob.getProject() + " ***");
                     buildLogMessage.append(System.lineSeparator());
-                    try (FileReader buildLogReader = new 
FileReader(buildLogFile)) {
+                    try (Reader buildLogReader = 
Files.newBufferedReader(buildLogFile.toPath())) {
                         
buildLogMessage.append(IOUtil.toString(buildLogReader));
                     }
                     buildLogMessage.append("*** end build.log for: " + 
buildJob.getProject() + " ***");

Reply via email to