In this quick post I will show you what you need to do to show colours in your maven build.
- Navigate to wherever you have installed maven and go into the lib folder
~/apache-maven-3.3.1/lib
- Delete slf4j-simple-1.7.5.jar
- Find on the internet the following jars and add them to the lib folder
log4j-api-2.2.jar
log4j-core-2.2.jar
log4j-slf4j-impl-2.2.jar
slf4j-ext-1.7.5.jar - 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"
?>
<
Configuration
>
<
Properties
>
<
Property
name
=
"maven.logging.root.level"
>INFO</
Property
>
</
Properties
>
<
Appenders
>
<
Console
name
=
"console"
target
=
"SYSTEM_OUT"
>
<
PatternLayout
pattern
=
"%highlight{[%p] %msg%n%throwable}"
/>
</
Console
>
</
Appenders
>
<
Loggers
>
<
Root
level
=
"${sys:maven.logging.root.level}"
>
<
Appender-ref
ref
=
"console"
/>
</
Root
>
</
Loggers
>
</
Configuration
>
- Go to the terminal and try building a maven project
No comments:
Post a Comment