DevOps / Maven Surefire Plugin Interview Questions
What is the difference between the Surefire and Failsafe plugins?
Surefire and Failsafe both run tests, but they target different stages of the build.
| Surefire | Failsafe |
Runs unit tests in the test phase | Runs integration tests in integration-test/verify |
| A failing test fails the build immediately | Failures are recorded but checked only in the verify goal, after cleanup |
This separation matters because integration tests often need setup/teardown (like a running server) that must happen even if a test fails.
More Related questions...