Can Maven be made less detailed?

Maven spews too many output lines for my taste (I like the Unix way: no news - good news).

I want to get rid of all the [INFO] lines, but I could not find any mention of argument or configuration parameters that control Maven verbosity.

Is there a LOG4J way to set log level?

+86
maven output maven-2 verbosity
Sep 16 '08 at 10:34
source share
8 answers

You can try the -q switch.

-q, - -q silent silent output - only show errors

+108
Sep 16 '08 at 10:37
source share

-q, as stated above, is what you need. An alternative could be

-B , - batch mode Launch in non-interactive (batch) mode Batch mode is necessary if you need to run Maven in a non-interactive, continuous integration environment. When launched in non-interactive mode, Maven will never stop accepting input from the user. Instead, it will use reasonable defaults when it requires input.

It will also reduce output messages to a greater or lesser extent to the necessary.

+23
Nov 10 '16 at 18:58
source share

Use the -q or --quiet command line options

+6
Sep 16 '08 at 10:38
source share

Official link: https://maven.apache.org/maven-logging.html

You can add to JVM parameters:

-Dorg.slf4j.simpleLogger.defaultLogLevel=WARN 

Beware of UPPERCASE.

+6
Jul 27 '17 at 8:16
source share

Maven 3.1.x uses SLF4j for logging, you can find instructions on how to configure it in https://maven.apache.org/maven-logging.html

In short: either change ${MAVEN_HOME}/conf/logging/simplelogger.properties , or set the same properties using the MAVEN_OPTS environment MAVEN_OPTS .

For example: setting MAVEN_OPTS to -Dorg.slf4j.simpleLogger.log.org.apache.maven.cl‌​i.transfer.Slf4jMave‌​nTransferListener=wa‌​rn sets the batch mode -Dorg.slf4j.simpleLogger.defaultLogLevel=warn , and -Dorg.slf4j.simpleLogger.defaultLogLevel=warn sets the default log level.

0
Dec 6 '16 at 18:25
source share

If you want to get rid of only [INFO] messages, you can also do:

 mvn ... | fgrep -v "[INFO]" 

To suppress all output (except errors), you can redirect the standard stdout to /dev/null with:

 mvn ... 1>/dev/null 

(This only works if you use bash (or similar shells) to run Maven commands.)

0
Feb 26 '18 at 12:57
source share

The existing answer will help you --quiet log-level filtering using --quiet . I found that many INFO messages are useful for debugging, however the artifact download log messages, such as the following, were noisy and useless.

 Downloading: http://nexus:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-compiler-plugin/maven-metadata.xml 

I found this solution:

https://blogs.itemis.com/en/in-a-nutshell-removing-artifact-messages-from-maven-log-output

 mvn clean install -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn 
0
May 03 '19 at 4:06
source share

My problem is that -q is too quiet. I am running Maven under CI

In Maven 3.6.1 (April 2019), you now have the option to suppress the transfer process when loading / unloading interactively .

 mvn --no-transfer-progress .... 

or shorter:

 mvn -ntp ... .... 

This is what Ray suggested in the comments on the MNG-6605 and PR 239 .

0
May 13 '19 at 18:43
source share



All Articles