Skip to content

Embedded MavenCli.doMain ignores --color=yes in 3.10.0 #13357

Closed

Description

@slachiewicz

Affected version

3.10.0

Bug description

When Maven 3.10.0 runs embedded through MavenCli.doMain(String[], String, PrintStream, PrintStream), --color=yes no longer produces ANSI output. 3.9.x honours it. That is the entry point embedded launchers use, such as maven-executor's EmbeddedMavenExecutor.

Since the JAnsi to JLine migration in #11874, MessageUtils.isColorEnabled() returns colorEnabled && terminal != null. The terminal is only installed by MessageUtils.systemInstall() in MavenCli.main(String[], ClassWorld). doMain never installs it, so setColorEnabled(true) from --color=yes has no effect there.

apache/maven-executor runs the same test against both versions. defaultFs3CaptureOutputWithForcedColor passes on 3.9.16 and fails on 3.10.0 with No ANSI codes present, for the embedded executor only; the forked executor passes on both. See apache/maven-executor#62.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions