如果测试失败,我可以对 Maven 集成测试结果运行后处理吗?
我想扩展 maven2 POM 以对我的集成测试结果运行一些后处理。我添加了一个 java:exec 插件并将其绑定到 post-integration-test 阶段。
当测试通过时一切都很好,但如果我遇到任何测试失败,则不会执行后处理。
问题:无论集成测试阶段的结果如何,是否可以选择强制执行任务?
I want to extend a maven2 POM to run some post processing on my integration test results. I added a java:exec
plugin and bound it to the post-integration-test
phase.
All is fine when the tests pass but if I get any test failures then the post processing isn't executed.
Question: Is there an option to force a task, regardless of the results of the integration test phase?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们的 POM 使用 Surefire 插件来执行集成测试,但看起来这是一个错误。 Failsafe 插件旨在解决这个问题。从文档中:
http://maven.apache.org/plugins/maven-failsafe-plugin/
Our POM was using the Surefire plugin to execute the integration tests but it looks like that was a mistake. The Failsafe plugin is intended to address this issue. From the documentation:
http://maven.apache.org/plugins/maven-failsafe-plugin/