Adding colour to maven

Thanks to @bertvanhooff, I found a link to a script to get colorized maven output in bash, see Very nice.

I did have quite a bit of trouble to get this working in Ubuntu using gnome-terminal.

  • For some reason neither copy/paste of the original script or file copying after a git clone worked. I had to replace the escape characters in the script by “\x1b” (without the quotes).
  • gnome-terminal by on Ubuntu runs as a login shell, meaning that .bashrc is not read at startup. This can be changed in the “default” profile, on the “title and command” tab.

Note however that this can play havoc with some plug-ins. Specifically, the maven release plug-in will hang when releasing from a git repository when maven output is colourized. Starting a new console using bash -login can do the trick.

Leave a Reply

Your email address will not be published. Required fields are marked *

question razz sad evil exclaim smile redface biggrin surprised eek confused cool lol mad twisted rolleyes wink idea arrow neutral cry mrgreen