If I am seeing errors like this after updating jun...
# community-support
e
If I am seeing errors like this after updating junit to 5.12.0 does that mean that Gradle doesn't support it yet, or is there something else wrong?
Copy code
Caused by: org.junit.platform.commons.JUnitException: OutputDirectoryProvider not available; probably due to unaligned versions of the junit-platform-engine and junit-platform-launcher jars on the classpath/module path.
c
did you specify both platform-engine/launcher yourself?
e
I haven't specified launcher. I just use:
Copy code
tasks.withType<Test> {
  useJUnitPlatform()
  outputs.upToDateWhen { false }
}
c
there was a thing a while ago that said support for not specifying was going away... if you're not using any other kind of bom, I highly recommend using junits
libs.versions.toml
Copy code
[libraries]
junit-api = { module = "org.junit.jupiter:junit-jupiter-api" }
junit-bom = "org.junit:junit-bom:5.+"
junit-parameters = { module = "org.junit.jupiter:junit-jupiter-params" }
junit-engine = { module = "org.junit.jupiter:junit-jupiter-engine" }
junit-launcher = { module = "org.junit.platform:junit-platform-launcher" }
[bundles]
test-impl = ["junit-api", "assertj", "junit-parameters"]
test-runtime = ["junit-engine", "junit-launcher"]
c
this is syntax for jvm test suite, adapt accordingly 😉
Copy code
implementation(platform(libs.junit.bom))
        implementation.bundle(libs.bundles.test.impl)
        runtimeOnly.bundle(libs.bundles.test.runtime)
note: I'm not 100% certain this is your problem, but it should fix it
v
I think it is, also was my first thought, just searched for the link first. :-D
👍 1
e
That looks like it worked, thanks!
👍 1
👌 1