Skip to content
Sharp

Build Tools · interview question

How can you fail a build in Maven if even a single test fails?

Multiple choiceMediumchapter-10-curatedpremiumbuild-toolsbuild-lifecycle
Choose one answer
Answer and explanation

Correct answer

D. This is default behavior in Maven

Why

Maven's default behavior is to fail the build if any test fails during the 'test' phase. This ensures that no broken code gets inadvertently packaged or deployed.

Test yourself on Build Tools

A free test with instant, explained results. No account needed.

Start free test
All Build Tools questions →