maven spews control characters to its output
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
maven (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
When compiling with the new maven included with Ubuntu 18.04, the compilation output is littered with control characters (even if TERM is set to "dumb").
How to get rid of this, it's really hard to read.
mvn -q -Duser.
[[1;31mERROR[m] COMPILATION ERROR :
[[1;31mERROR[m] /home/alain/
[[1;31mERROR[m] Failed to execute goal [32morg.
[[1;31mERROR[m] [1;31m/
[[1;31mERROR[m] [1;31m[m
[[1;31mERROR[m] -> [1m[Help 1][m
[[1;31mERROR[m]
[[1;31mERROR[m] To see the full stack trace of the errors, re-run Maven with the [1m-e[m switch.
[[1;31mERROR[m] Re-run Maven using the [1m-X[m switch to enable full debug logging.
[[1;31mERROR[m]
[[1;31mERROR[m] For more information about the errors and possible solutions, please read the following articles:
[[1;31mERROR[m] [1m[Help 1][m http://
Compilation failed
Compilation exited abnormally with code 1 at Tue May 29 10:17:20
+++++++
$ lsb_release -rd
Description: Ubuntu 18.04 LTS
Release: 18.04
$ apt-cache policy maven
maven:
Installed: 3.5.2-2
Candidate: 3.5.2-2
Version table:
*** 3.5.2-2 500
500 http://
500 http://
100 /var/lib/
3) What I expected: clean output as was the case in 16.04. Such as:
[ERROR] COMPILATION ERROR :
[ERROR] /home/alain/
4) What happened instead: output interspersed control codes (see above)
The extra control characters looks related to the color output which was added in Maven 3.5.x. You have probably found this in the meantime, but could you try to add `-B` for batch mode when running mvn and see if that helps? That should disable the color, and also the incremental lines when downloading packages among other things...