Can Maven be made less verbose?
Solution 1
You can try the -q
switch.
-q
,--quiet
Quiet output - only show errors
Solution 2
-q
as said above is what you need. An alternative could be:
-B
,--batch-mode
Run in non-interactive (batch) mode Batch mode is essential if you need to run Maven in a non-interactive, continuous integration environment. When running in non-interactive mode, Maven will never stop to accept input from the user. Instead, it will use sensible default values when it requires input.
And will also reduce the output messages more or less to the essentials.
Solution 3
My problem is that -q is too quiet. I'm running maven under CI
With Maven 3.6.1 (April 2019), you now have an option to suppress the transfer progress when downloading/uploading in interactive mode.
mvn --no-transfer-progress ....
or in short:
mvn -ntp ... ....
That is what Ray proposed in the comments with MNG-6605 and PR 239.
Solution 4
Official link : https://maven.apache.org/maven-logging.html
You can add in the JVM parameters :
-Dorg.slf4j.simpleLogger.defaultLogLevel=WARN
Beware of UPPERCASE.
Solution 5
Use the -q or --quiet command-line options
Asaf Bartov
In a past life, I hacked C, Perl and Ruby on Windows and all Unixen for fun and profit. I did C++ strictly for profit, and under protest. Now I only do software as a hobby, so I get to only use Ruby and JavaScript, whee! :) I run Project Ben-Yehuda, and I work for the Wikimedia Foundation. My code is on GitHub: https://github.com/abartov
Updated on August 30, 2020Comments
-
Asaf Bartov almost 4 years
Maven spews out far too many lines of output to my taste (I like the Unix way: no news is good news).
I want to get rid of all
[INFO]
lines, but I couldn't find any mention of an argument or config settings that controls the verbosity of Maven.Is there no LOG4J-like way to set the log level?
-
codeturner about 11 years@sheki: To clarify, this option does not disable logger debug messages - you need turn that off via your logger settings. For example, if you're using logback, including a src/test/resources/logback-test.xml file in your project will let you customize your logging level to 'off' during the test phase. This will clean everything up.
-
Guss almost 8 yearsMy problem is that
-q
is too quiet. I'm running maven under CI, and I want to see the steps it takes (to track progress), but the download indicators are making mess of the non-ANSI display. Is there a way to only turn off the download progress indicators? -
ankon over 7 years@Guss: If you only want the Downloading/Downloaded messages to go away, use
-B
to enable batch mode (you should have that in your CI system anyways!), and then setMAVEN_OPTS="-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
to kill the progress information for the downloads. -
Auke over 6 yearsIn maven 3.5.x I actually need to enable
--batch-mode
(-B
) for the-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
trick to work. -
Stanislav over 6 yearsit is used for non-interactive mode, which helps when automating runs
-
Ray about 5 yearsif you are inclined I've submitted a proposed solution compatible with interactive mode issues.apache.org/jira/browse/MNG-6605 , github.com/apache/maven/pull/239
-
user1511417 about 4 years
-q
kind of works here (mvn 3.6.0, java 11.0.6) . Unfortunately I still get warnings like this:WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.
etc. -
Hilikus about 4 yearsThis solution suppresses upload messages as well as downloads, which is usually not desired in a
deploy
task