-Dmaven.color=false not working
Closed this issue · 5 comments
I'm using Homebrew jcgay/jcgay/maven-deluxe 3.3.9-0 on Mac OS X El Capitan 10.11.3 with Oracle JDK 1.7.0_80. When I run the following command, the ANSI color codes are still included, making tree.txt look like a mess:
mvn dependency:tree -Dverbose -Dmaven.color=false > /tmp/tree.txt
On a related note, I think it would make sense for colorized output to automatically be disabled when Maven is in batch mode, i.e. the -B option:
-B,--batch-mode Run in non-interactive (batch) mode
Thanks for the report !
I'm curious did I let references to maven.color
configuration somewhere in the documentation ? This was a parameter available for maven 3.0.x but this is not effective anymore.
I think I can implement it again with Logback
, I'll have to look around for Log4j 2
...
I don't know if you are aware of, but you can use the outputFile parameter to export your dependencies. This will not print ANSI codes.
For your second point, I don't know if I will be able to access this kind of configuration from Logback
or Log4j 2
, but I will have a look.
I found the reference to the maven.color property in https://github.com/jcgay/maven-color/blob/master/CHANGELOG.md.
Thanks for the info on the outputFile property - that should do the trick for my use case! I looked for a way to disable the colors via Maven and maven-color but didn't think to check the dependency-plugin's config options.
I have released a version where color can be disabled when launching mvn
: https://github.com/jcgay/maven-color/wiki#disable-coloring
If it does not fit your needs, feel free to reopen the issue, Thanks !
Awesome - thanks!