diff --git a/api/maven-api-cli/src/main/java/org/apache/maven/api/cli/Options.java b/api/maven-api-cli/src/main/java/org/apache/maven/api/cli/Options.java index 5a486bf2152f..ecb6ab17afc9 100644 --- a/api/maven-api-cli/src/main/java/org/apache/maven/api/cli/Options.java +++ b/api/maven-api-cli/src/main/java/org/apache/maven/api/cli/Options.java @@ -87,7 +87,7 @@ public interface Options { Optional verbose(); /** - * Indicates whether to show error messages. + * Indicates whether to show error stack traces. * * @return an {@link Optional} containing the boolean flag, or empty if not set */ diff --git a/maven-cli/src/main/java/org/apache/maven/cling/invoker/CommonsCliOptions.java b/maven-cli/src/main/java/org/apache/maven/cling/invoker/CommonsCliOptions.java index c3adcb5ee10f..8315266cef8a 100644 --- a/maven-cli/src/main/java/org/apache/maven/cling/invoker/CommonsCliOptions.java +++ b/maven-cli/src/main/java/org/apache/maven/cling/invoker/CommonsCliOptions.java @@ -97,7 +97,7 @@ public Optional verbose() { @Override public Optional showErrors() { - if (commandLine.hasOption(CLIManager.SHOW_ERRORS)) { + if (commandLine.hasOption(CLIManager.SHOW_ERRORS) || verbose().orElse(false)) { return Optional.of(Boolean.TRUE); } return Optional.empty();