Skip to content
Sharp

Build Tools · interview question

Which Maven command would you use to ensure that the project is cleaned and rebuilt, including tests?

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

Correct answer

B. Mvn clean install

Why

The 'mvn clean install' command first removes any previously compiled artifacts and then builds the project from scratch, including running the tests. This ensures a fresh build environment.

Test yourself on Build Tools

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

Start free test
All Build Tools questions →