diff --git a/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java b/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java index 28bd6f5da..1a2d143c4 100644 --- a/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java +++ b/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java @@ -165,7 +165,7 @@ public static void main(String[] argv) throws Exception { } catch (DaemonException.InterruptedException e) { final AttributedStyle s = new AttributedStyle().bold().foreground(AttributedStyle.RED); String str = new AttributedString(System.lineSeparator() + "Canceled by user", s).toAnsi(); - output.accept(Message.display(str)); + output.accept(Message.err(str)); exitCode = 130; } } diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/Message.java b/common/src/main/java/org/mvndaemon/mvnd/common/Message.java index f274f9402..8b4897bf4 100644 --- a/common/src/main/java/org/mvndaemon/mvnd/common/Message.java +++ b/common/src/main/java/org/mvndaemon/mvnd/common/Message.java @@ -499,6 +499,8 @@ public String toString() { private String mnemonic() { switch (type) { + case DISPLAY: + return "Display"; case PROJECT_LOG_MESSAGE: return "ProjectLogMessage"; default: @@ -730,8 +732,6 @@ private String mnemonic() { return "KeyboardInput"; case BUILD_LOG_MESSAGE: return "BuildLogMessage"; - case DISPLAY: - return "Display"; case PRINT_OUT: return "PrintOut"; case PRINT_ERR: @@ -1112,10 +1112,6 @@ public static StringMessage buildStatus(String payload) { return new StringMessage(BUILD_STATUS, payload); } - public static StringMessage display(String message) { - return new StringMessage(DISPLAY, message); - } - public static RequestInput requestInput(String projectId) { return new RequestInput(projectId); } diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java b/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java index dbf475d23..9f974f44c 100644 --- a/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java +++ b/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java @@ -312,9 +312,9 @@ private boolean doAccept(Message entry) { break; } case Message.DISPLAY: { - Message.StringMessage d = (Message.StringMessage) entry; clearDisplay(); - terminal.writer().printf("%s%n", d.getMessage()); + Message.ProjectEvent d = (Message.ProjectEvent) entry; + terminal.writer().printf("[%s] %s%n", d.getProjectId(), d.getMessage()); break; } case Message.PRINT_OUT: { diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/assertj/TestClientOutput.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/assertj/TestClientOutput.java index 1daa9c317..524a6ae72 100644 --- a/integration-tests/src/test/java/org/mvndaemon/mvnd/assertj/TestClientOutput.java +++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/assertj/TestClientOutput.java @@ -59,7 +59,7 @@ public void accept(List messages) { @Override public void describeTerminal() { - accept(Message.display("Test terminal")); + accept(Message.display("test", "Test terminal")); } @Override