You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Guillaume Nodet (Jira)" <ji...@apache.org> on 2020/12/01 09:01:00 UTC

[jira] [Commented] (MNG-6380) Option -Dstyle.color=always doesn't force color output

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

Guillaume Nodet commented on MNG-6380:
--------------------------------------

I can enhance Jansi so delay the wrapping of the system streams at the time the {{AnsiConsole.install()}} method is called.  This should not be very disruptive to other libraries.  If needed, I can re-introduce another system property to eagerly wrap the streams.

> 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: Improvement
>    Affects Versions: 3.5.3
>            Reporter: Henning Hoefer
>            Priority: Minor
>              Labels: workaround-exists
>
> 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.3.4#803005)