[ 
https://issues.apache.org/jira/browse/MNG-6380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17810298#comment-17810298
 ] 

Alexis Tual commented on MNG-6380:
----------------------------------

This does not work with Maven 4.0.0-alpha-12: 
`./mvnw clean verify -Dstyle.color=always | less -R` => no colors in the output.

Also our tests use `ProcessBuilder` to launch Maven and consume the output 
stream, by default (without any `style.color` flag) we don't get any colors in 
the output with `4.0.0-alpha-12` whereas we do get them in all `3.9.x` tests.

I guess it's caused by https://github.com/apache/maven/pull/1279 ? 

> Option -Dstyle.color=always doesn't force color output
> ------------------------------------------------------
>
>                 Key: MNG-6380
>                 URL: https://issues.apache.org/jira/browse/MNG-6380
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 3.5.3
>            Reporter: Henning Hoefer
>            Assignee: Michael Osipov
>            Priority: Minor
>              Labels: workaround-exists
>             Fix For: 3.8.2, 4.0.0-alpha-2, 4.0.0
>
>
> When the output is not a TTY (e.g. on a CI server), the new option 
> {{-Dstyle.color=always}} doesn't work, because JAnsi itself is disabling its 
> color output.
> {code:bash}
> # OK, produces color:
> mvn -B -Dstyle.color=always package
> # FAIL, doesn't produce color:
> mvn -B -Dstyle.color=always package | less -R
> # WORKAROUND:
> MAVEN_OPTS=-Djansi.force=true mvn -B -Dstyle.color=always package | less -R
> {code}
> The {{-Dstyle.color=always}} option needs to imply {{-Djansi.force=true}} – 
> otherwise, "always" doesn't really mean always.
> The problem for the implementation is, that the JAnsi option needs to be set 
> as a system property way early during startup.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to