diff --git a/common/src/main/java/org/jboss/fuse/mvnd/common/logging/TerminalOutput.java b/common/src/main/java/org/jboss/fuse/mvnd/common/logging/TerminalOutput.java index add1707dc..76dfa2e8e 100644 --- a/common/src/main/java/org/jboss/fuse/mvnd/common/logging/TerminalOutput.java +++ b/common/src/main/java/org/jboss/fuse/mvnd/common/logging/TerminalOutput.java @@ -107,20 +107,24 @@ public TerminalOutput(Path logFile) throws IOException { @Override public void accept(Message entry) { assert "main".equals(Thread.currentThread().getName()); - doAccept(entry); - update(); + if (doAccept(entry)) { + update(); + } } @Override public void accept(List entries) { assert "main".equals(Thread.currentThread().getName()); + boolean update = true; for (Message entry : entries) { - doAccept(entry); + update &= doAccept(entry); + } + if (update) { + update(); } - update(); } - private void doAccept(Message entry) { + private boolean doAccept(Message entry) { switch (entry.getType()) { case Message.BUILD_STARTED: { BuildStarted bs = (BuildStarted) entry; @@ -147,7 +151,7 @@ private void doAccept(Message entry) { final AttributedStyle s = new AttributedStyle().bold().foreground(AttributedStyle.RED); new AttributedString(msg, s).println(terminal); terminal.flush(); - return; + return false; } case Message.PROJECT_STARTED: case Message.MOJO_STARTED: { @@ -180,7 +184,7 @@ private void doAccept(Message entry) { } finally { terminal.flush(); } - return; + return false; } case Message.KEEP_ALIVE: { break; @@ -193,7 +197,6 @@ private void doAccept(Message entry) { } case Message.PROMPT: { Message.Prompt prompt = (Message.Prompt) entry; - readInput.writeLock().lock(); try { display.update(Collections.emptyList(), 0); @@ -265,7 +268,7 @@ private void doAccept(Message entry) { } break; } - + return true; } @Override