Skip to content

Commit

Permalink
[MNG-8582] Keep stdout/stderr functioning (#2112)
Browse files Browse the repository at this point in the history
This call has severe implications (re-ties logger, and in case is invoked multiple times, causes "loop").
Make sure it happens only once, This changes does not affect mvn and mvnd (it installs own stdout/stderr), but does affects mvnsh and resident maven,

---

https://issues.apache.org/jira/browse/MNG-8582
  • Loading branch information
cstamas authored Feb 15, 2025
1 parent d50b7cd commit 16df3de
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,6 @@ protected void configureLogging(C context) throws Exception {
context.slf4jConfiguration.setRootLoggerLevel(context.loggerLevel);
// else fall back to default log level specified in conf
// see https://issues.apache.org/jira/browse/MNG-2570

// Create the build log appender; also sets MavenSimpleLogger sink
ProjectBuildLogAppender projectBuildLogAppender =
new ProjectBuildLogAppender(determineBuildEventListener(context));
context.closeables.add(projectBuildLogAppender);
}

protected BuildEventListener determineBuildEventListener(C context) {
Expand All @@ -305,6 +300,11 @@ protected BuildEventListener doDetermineBuildEventListener(C context) {

protected void createTerminal(C context) {
if (context.terminal == null) {
// Create the build log appender; also sets MavenSimpleLogger sink
ProjectBuildLogAppender projectBuildLogAppender =
new ProjectBuildLogAppender(determineBuildEventListener(context));
context.closeables.add(projectBuildLogAppender);

MessageUtils.systemInstall(
builder -> {
if (context.invokerRequest.embedded()) {
Expand Down

0 comments on commit 16df3de

Please sign in to comment.