in common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java [561:597]
private AttributedString formatFailures() {
if (failures.isEmpty()) {
return null;
}
AttributedStringBuilder asb = new AttributedStringBuilder();
asb.style(AttributedStyle.DEFAULT.foreground(AttributedStyle.RED).bold());
if (failures.stream().anyMatch(ExecutionFailureEvent::isHalted)) {
asb.append("ABORTING ");
}
asb.append("FAILURE: ");
asb.style(AttributedStyle.DEFAULT.foreground(AttributedStyle.RED));
if (failures.size() == 1) {
ExecutionFailureEvent efe = failures.iterator().next();
asb.append(efe.getProjectId());
String exception = efe.getException();
if (exception != null) {
if (exception.startsWith("org.apache.maven.lifecycle.LifecycleExecutionException: ")) {
exception =
exception.substring("org.apache.maven.lifecycle.LifecycleExecutionException: ".length());
}
asb.append(": ").append(exception);
}
} else {
asb.append(String.valueOf(failures.size())).append(" projects failed: ");
asb.append(
failures.stream().map(ExecutionFailureEvent::getProjectId).collect(Collectors.joining(", ")));
}
AttributedString as = asb.toAttributedString();
if (as.columnLength() >= getTerminalWidth() - 1) {
asb = new AttributedStringBuilder();
asb.append(as.columnSubSequence(0, getTerminalWidth() - 2));
asb.style(AttributedStyle.DEFAULT);
asb.append("…");
as = asb.toAttributedString();
}
return as;
}