Can maven print a short summary of the reactor?

When the assembly of the maven multiproject completes, a summary of all components is printed as the final output. It looks like this:

[INFO] Compiling 5 source files to C:\project\target\classes ---------- 1. ERROR in C:\project\src\main\java\com\example\Foo.java (at line 100) foo.bar(); ^^^ The method bar() is undefined ---------- 3 problems (3 errors)[INFO] ------------------------------ [ERROR] COMPILATION ERROR : [INFO] --------------------------------------------------- [ERROR] Found 1 errors and 0 warnings. [INFO] 1 error [INFO] --------------------------------------------------- [INFO] ----------------------------------------- [INFO] Reactor Summary: [INFO] [INFO] Component 1 ... SUCCESS [1.000s] [INFO] Component 2 ... FAILURE [2.000s] [INFO] Component 3 ... SKIPPED [INFO] ----------------------------------------- [INFO] BUILD FAILURE [INFO] ----------------------------------------- [INFO] Total time: 3.000s [INFO] Finished at: Thu Jun 14 12:10:36 EDT 2012 [INFO] Final Memory: 579M/812M [INFO] ----------------------------------------- 

I have a very large project with over a hundred components. If a failure occurs, I would like the error message and its context to be very close to the bottom of the output. Is there any way to reduce this reduction? Instead of listing all the components, I just want it to show the last component and whether it ran or failed.

+6
source share
2 answers

I had similar problems. What I am doing is doing mvn somegoal -l file.log and then grep through file.log

+1
source

No, you canโ€™t. I tried to find out a while ago, and, unfortunately, I did not find anything. You cannot even control logging by ignoring certain levels, etc.

For me, it worked by processing Maven output with a simple Python script that simply filters that output and collects the information I need.

+1
source

Source: https://habr.com/ru/post/918116/


All Articles