Why do Gradle docs specify "junit-platform-launcher" for JUnit 5 tests?

The Testing in Java & JVM projects documentation suggests the following dependencies.

dependencies {

However, my testing shows that only junit-jupiter is required in order to run unit tests:

  • via the Gradle test task
  • in IntelliJ IDEA

Here’s my example build.gradle.kts.

plugins {

repositories {

dependencies {

tasks.withType<Test>().configureEach {

What am I missing here? Why is junit-platform-launcher a suggested dependency, when it’s not required to run tests?

Maybe it should simply show testRuntimeOnly? Or maybe it was necessary but is not anymore? Or maybe it is just a doc bug?

I suggest you open an issue on GitHub, then the Gradle folks can have a look and clarify or fix it.

Good shout! Gradle team successfully poked.

1 Like