Sobes.tech
Junior — Middle

When does the testing begin during the Maven build process?

sobes.tech AI

Answer from AI

In Maven, tests are run in the test phase of the build lifecycle. This occurs after the compilation of the source code (compile) and before packaging (package).

Standard phase order:

  1. compile — compilation of main code
  2. test-compile — compilation of test code
  3. test — running tests

That is, test execution begins after the source and test code are compiled, but before the final artifact (e.g., JAR) is created. This allows verifying the correctness of the code before packaging and deployment.