Maven ANSI colour wrapper to give you shiny, readable output from Maven
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Output Highlighting for Maven

I miss Ant's AnsiColorLogger. So I found a blog post and another blog post, spent some time messing around, and decided to share the results on GitHub. It works by wrapping your wrapping your Maven command and then inserting ANSI colour codes in the output.

To Colorize Maven Output

  • put the file in a handy directory (like ~/scripts)
  • add a link to it in your .bashrc (or other shell's initialization file)
  • example below:
mkdir -p ${HOME}/scripts # make a place for the script to live  
cp mvn ${HOME}/scripts echo "[[ -s \"${HOME}/scripts/mvn\" ]] && source \"${HOME}/scripts/mvn\"" >> ${HOME}/.bashrc # add to RC file
. ${HOME}/bashrc # to re-read your bash configuration
  • alternatively, in recent Ubuntu Linux and OSX the default ~/.bashrc looks for alias additions in a separate file, that you can simply append to:
curl -L >> ~/.bash_aliases

How do you spell 'colour'?

With a u in it. Until you realise that you're outnumbered by people who use the Georgian-era spelling