maven spews control characters to its output

Bug #1773933 reported by AlainKnaff
8
This bug affects 1 person
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.timezone="Europe/Luxembourg" -Dgwt.draftCompile=true -P devel package
[ERROR] COMPILATION ERROR :
[ERROR] /home/alain/Projects/BECKS/prog/BECKS/src/main/java/com/aev/BECKS/server/services/DocumentDownloadServlet.java:[33,17] ';' expected
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project BECKS: Compilation failure
[ERROR] /home/alain/Projects/BECKS/prog/BECKS/src/main/java/com/aev/BECKS/server/services/DocumentDownloadServlet.java:[33,17] ';' expected
[ERROR] 
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
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://be.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://be.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
        100 /var/lib/dpkg/status

3) What I expected: clean output as was the case in 16.04. Such as:
[ERROR] COMPILATION ERROR :
[ERROR] /home/alain/Projects/BECKS/prog/BECKS/src/main/java/com/aev/BECKS/server/services/DocumentDownloadServlet.java:[33,17] ';' expected

4) What happened instead: output interspersed control codes (see above)

Tags: bionic
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

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...

affects: maven-assembly-plugin (Ubuntu) → maven (Ubuntu)
tags: added: bionic
Revision history for this message
AlainKnaff (kubuntu-misc) wrote :

Yes, indeed, I did find --batch-mode in the meantime, thanks.

Still, taking into account the TERM variable would be useful, especially since not all terminals might have the same color codes.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.