Enabling Maven logging

Everything does not work fine all the time. The connectivity to an external repository or a server can fail due to many reasons. Maven debugging helps you to nail down the root cause in such a situation. To run Maven with debug level logs enabled, use the following command:

$ mvn clean install -X

Maven 3.1.0 and higher versions use the SLF4J logging API. The following logging configuration available at MAVEN_HOME/conf/logging/simplelogger.properties can be used to alter the default behavior of Maven logging:

org.slf4j.simpleLogger.defaultLogLevel=info org.slf4j.simpleLogger.showDateTime=false org.slf4j.simpleLogger.showThreadName=false org.slf4j.simpleLogger.showLogName=false org.slf4j.simpleLogger.logFile=System.out org.slf4j.simpleLogger.levelInBrackets=true ...

Get Mastering Apache Maven 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.