最终使用Maven目标获取所有模块测试摘要
我在项目中使用Maven,其中有多个子模型。 文件夹结构中的POM看起来像:
root/pom.xml
A/pom.xml
B/pom.xml
父pom中的子模块定义如下:
<modules>
<module>A</module>
<module>B</module>
</modules>
当我在root pom上运行mvn test
时。
我的子模块按照父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。如果是,那怎么样?
I am using maven in my project it has multiple submodules in it.
The pom in folder structure looks like this:
root/pom.xml
A/pom.xml
B/pom.xml
The submodule definition in the parent pom looks like below:
<modules>
<module>A</module>
<module>B</module>
</modules>
When I run mvn test
on the root pom.
My submodules are executed in the order defined in the parent pom.
My console log looks like
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
What I want is an aggregated test summary in the end something like this.
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
Is this possible using maven. if yes then how?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论