Thursday, July 9, 2015

Maven build in colours

Did you ever wonder, how you can make your maven build display colours?
In this quick post I will show you what you need to do to show colours in your maven build.

  1. Navigate to wherever you have installed maven and go into the lib folder ~/apache-maven-3.3.1/lib
  2. Delete slf4j-simple-1.7.5.jar
  3. Find on the internet the following jars and add them to the lib folder

  4. Get out of the lib folder and navigate into the conf folder once in there create a file called log4j2.xml and add the following content:

    <?xml version="1.0" encoding="UTF-8" ?>
        <Property name="maven.logging.root.level">INFO</Property>
        <Console name="console" target="SYSTEM_OUT">
          <PatternLayout pattern="%highlight{[%p] %msg%n%throwable}" />
        <Root level="${sys:maven.logging.root.level}">
          <Appender-ref ref="console"/>
  5. Go to the terminal and try building a maven project

No comments:

Post a Comment

Share with your friends