From 80107b05d8404efbf85c0eff539a06172621141b Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Sun, 22 Dec 2024 13:24:10 +0100 Subject: [PATCH] [MNG-8460] Implement flush() (#2006) LoggingOutputStream used by default as sysout and syserr were NOT flushing (def method is empty), and flush happened only when EOL was printed. Still, prompts and help:evaluate does print out unterminated strings. --- https://issues.apache.org/jira/browse/MNG-8460 --- .../java/org/apache/maven/logging/LoggingOutputStream.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/impl/maven-core/src/main/java/org/apache/maven/logging/LoggingOutputStream.java b/impl/maven-core/src/main/java/org/apache/maven/logging/LoggingOutputStream.java index 5d7ee4b107..037307f8e4 100644 --- a/impl/maven-core/src/main/java/org/apache/maven/logging/LoggingOutputStream.java +++ b/impl/maven-core/src/main/java/org/apache/maven/logging/LoggingOutputStream.java @@ -56,6 +56,11 @@ public class LoggingOutputStream extends FilterOutputStream { } } + @Override + public void flush() throws IOException { + forceFlush(); + } + public void forceFlush() { if (buf.size() > 0) { String line = new String(buf.toByteArray(), 0, buf.size());