Wednesday 10 July 2019

Maven: Make the maven output less verbose


When I ran ‘mvn clean install’ on a simple ‘pom.xml’ file, I got below information.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.selflearningjava:helloworld >-------------------
[INFO] Building helloworld 1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ helloworld ---
[INFO] Deleting C:\Users\krishna\Documents\Study\Maven\projects\helloworld\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ helloworld ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ helloworld ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\krishna\Documents\Study\Maven\projects\helloworld\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ helloworld ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\krishna\Documents\Study\Maven\projects\helloworld\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ helloworld ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\krishna\Documents\Study\Maven\projects\helloworld\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ helloworld ---
[INFO] Surefire report directory: C:\Users\krishna\Documents\Study\Maven\projects\helloworld\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.sample.demo.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ helloworld ---
[INFO] Building jar: C:\Users\krishna\Documents\Study\Maven\projects\helloworld\target\helloworld-1.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ helloworld ---
[INFO] Installing C:\Users\krishna\Documents\Study\Maven\projects\helloworld\target\helloworld-1.jar to C:\Users\krishna\.m2\repository\org\selflearningjava\helloworld\1\helloworld-1.jar
[INFO] Installing C:\Users\krishna\Documents\Study\Maven\projects\helloworld\pom.xml to C:\Users\krishna\.m2\repository\org\selflearningjava\helloworld\1\helloworld-1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.318 s
[INFO] Finished at: 2018-05-03T11:09:47+05:30
[INFO] ------------------------------------------------------------------------

I really don't want to know all the info and debug messages. I just want to know, is there any error messages, what is the final outcome of the command.

You can use the option -q, --quite to suppress info, warn and debug messages. It displays only error messages.


When I ran the command ‘mvn -q clean install’, I seen below output.

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.sample.demo.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0




Previous                                                    Next                                                    Home

No comments:

Post a Comment