Skip to content

Commit

Permalink
SpecifyUTF-8 when reading build log
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo committed Dec 6, 2024
1 parent dccc59a commit 3382073
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
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.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -210,7 +212,7 @@ public void logFailedBuildLog(Log logger, boolean ignoreFailures) throws MojoFai
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(), StandardCharsets.UTF_8)) {
buildLogMessage.append(IOUtil.toString(buildLogReader));
}
buildLogMessage.append("*** end build.log for: " + buildJob.getProject() + " ***");
Expand Down

0 comments on commit 3382073

Please sign in to comment.