我在我的项目中使用maven,它有多个子模块。
pom-in文件夹结构如下所示:
root/pom.xml
A/pom.xml
B/pom.xml
父pom中的子模块定义如下所示:
<modules>
<module>A</module>
<module>B</module>
</modules>
当我跑步时
mvn test
在根pom上。
我的子模块按照父pom中定义的顺序执行。
我的控制台日志看起来像
Some Log for sub project A
...
...
...
[INFO] Results:
[INFO]
[WARNING] Tests run: 523, Failures: 0, Errors: 0, Skipped: 0
Some Log for sub project B
...
...
...
[INFO] Results:
[INFO]
[WARNING] Tests run: 560, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Root Project ....................................... SUCCESS [ 3.271 s]
[INFO] A ................................................ SUCCESS [ 2.001 s]
[INFO] B ................................................ SUCCESS [ 1.270 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
我想要的是一个汇总的测试摘要
最后
像这样的东西。
Some Log for sub project A
...
...
...
Some Log for sub project B
...
...
...
[INFO] Results:
[INFO] <---- consolidated submodule test result
[WARNING] Tests run: 523, Failures: 0, Errors: 0, Skipped: 0
[WARNING] Tests run: 560, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Root Project ....................................... SUCCESS [ 3.271 s]
[INFO] A ................................................ SUCCESS [ 2.001 s]
[INFO] B ................................................ SUCCESS [ 1.270 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
使用maven可以做到这一点吗。如果是,那怎么办?