Question: How do you run a single unit test in Maven?

  1. Maven runs only a single unit test by default.
  2. Use the -Dtest= flag and pass in the name of the test.
  3. Use a plugin that can specify the test you want to run.
  4. It is not possible to do this.

Answer: The correct answer of the above question is Option B:Use the -Dtest= flag and pass in the name of the test.