Skip to content

Migration of JUnit 4/5 Based Tests to JUnit 6

Discussion: https://github.com/support-and-care/maven-support-and-care/discussions/173

Original Item: "Migration of JUnit 4-based tests to JUnit 5/6 (JUnit 4 EOL) (Sandra)"

Problem Statement

The current tests in Apache Maven Core and Plugins are based on JUnit 4 and JUnit 5. JUnit 4 is in maintenance mode, and it is no longer supported by the community. JUnit 6 is the current version of the testing framework.

Current State / Starting Point

While working on the Change the surefire/failsafe plugin and using JUnit as a platform only, we already migrated JUnit 3-based tests or tests that had a dependency on JUnit 3 to JUnit 5. JUnit 5 was chosen because some JUnit-5-based tests exist. So in the end the test code base has tests based on JUnit 4 and 5.

Expected Outcomes / Benefits

All tests in the Apache Maven ecosystem (Core and Plugins) are migrated to JUnit 6. The benefit is that after the migration, the tests are based on the current version of the testing framework, so that continuous maintenance of the tests will be easier.

Discussion Summary

This proposal generated significant discussion. Key concerns include:

Final Discussion (2026-02-17)

  • Reduce expected outcome: Migrate to JUnit 5 (minimum) + JUnit 6 (in particular for Maven 4)
  • There should be no tests left with JUnit 4
  • Decision: Request Funding