While updating junit from 5.11.4
to 5.12.1
my Java Program failes to perform tests with the following exception:
Mär 31, 2025 1:34:48 PM .junit.platform.launcher.core.DefaultLauncher handleThrowable
WARNUNG: TestEngine with ID 'junit-jupiter' failed to discover tests
.junit.platformmons.JUnitException: OutputDirectoryProvider not available; probably due to unaligned versions of the junit-platform-engine and junit-platform-launcher jars on the classpath/module path.
at .junit.platform.engine.EngineDiscoveryRequest.getOutputDirectoryProvider(EngineDiscoveryRequest.java:94)
at .junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:67)
at .junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot(DefaultLauncher.java:168)
at .junit.platform.launcher.core.DefaultLauncher.discoverRoot(DefaultLauncher.java:155)
at .junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:120)
at .apache.maven.surefire.junitplatform.TestPlanScannerFilter.accept(TestPlanScannerFilter.java:56)
at .apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:102)
at .apache.maven.surefire.junitplatform.JUnitPlatformProvider.scanClasspath(JUnitPlatformProvider.java:143)
at .apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124)
at .apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
at .apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
at .apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
at .apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
My pom.xml includes the following dependencies:
<dependency>
<groupId>.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.12.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.12.1</version>
<scope>test</scope>
</dependency>
maven-surefire-plugin
and maven-failsafe-plugin
are integrated as a plugin with version 2.22.2
.
Even creating the dependency tree with maven, I dont see any conflicts concerning junit-jupiter:
[INFO] +- .slf4j:slf4j-api:jar:2.0.17:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.3.15:compile
[INFO] | +- (ch.qos.logback:logback-core:jar:1.3.15:compile - omitted for duplicate)
[INFO] | \- (.slf4j:slf4j-api:jar:2.0.7:compile - omitted for conflict with 2.0.17)
[INFO] +- ch.qos.logback:logback-core:jar:1.3.15:compile
[INFO] +- .projectlombok:lombok:jar:1.18.36:provided
[INFO] +- .apache.maven.plugins:maven-compiler-plugin:jar:3.14.0:compile
[INFO] | +- .apache.maven.shared:maven-shared-utils:jar:3.4.2:compile
[INFO] | | +- (.slf4j:slf4j-api:jar:1.7.36:compile - omitted for conflict with 2.0.17)
[INFO] | | \- commons-io:commons-io:jar:2.11.0:compile
[INFO] | +- .apache.maven.shared:maven-shared-incremental:jar:1.1:compile
[INFO] | +- .codehaus.plexus:plexus-java:jar:1.4.0:compile
[INFO] | | +- .ow2.asm:asm:jar:9.7.1:compile
[INFO] | | \- com.thoughtworks.qdox:qdox:jar:2.2.0:compile
[INFO] | +- .codehaus.plexus:plexus-compiler-api:jar:2.15.0:compile
[INFO] | | +- (.codehaus.plexus:plexus-utils:jar:4.0.0:compile - omitted for conflict with 4.0.1)
[INFO] | | \- (.slf4j:slf4j-api:jar:1.7.36:compile - omitted for conflict with 2.0.17)
[INFO] | +- .codehaus.plexus:plexus-compiler-manager:jar:2.15.0:compile
[INFO] | | +- (.codehaus.plexus:plexus-compiler-api:jar:2.15.0:compile - omitted for duplicate)
[INFO] | | +- javax.inject:javax.inject:jar:1:compile
[INFO] | | +- (.slf4j:slf4j-api:jar:1.7.36:compile - omitted for conflict with 2.0.17)
[INFO] | | \- .codehaus.plexus:plexus-xml:jar:3.0.0:compile
[INFO] | +- .codehaus.plexus:plexus-compiler-javac:jar:2.15.0:runtime
[INFO] | | +- (.codehaus.plexus:plexus-utils:jar:4.0.0:runtime - omitted for conflict with 4.0.1)
[INFO] | | +- (javax.inject:javax.inject:jar:1:runtime - omitted for duplicate)
[INFO] | | +- (.slf4j:slf4j-api:jar:1.7.36:runtime - omitted for conflict with 2.0.17)
[INFO] | | \- (.codehaus.plexus:plexus-compiler-api:jar:2.15.0:runtime - omitted for duplicate)
[INFO] | \- .codehaus.plexus:plexus-utils:jar:4.0.1:compile
[INFO] +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] | \- jakarta.activation:jakarta.activation-api:jar:1.2.2:compile
[INFO] +- javax.activation:activation:jar:1.1:compile
[INFO] +- .glassfish.jaxb:jaxb-runtime:jar:2.3.9:compile
[INFO] | +- (jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile - omitted for duplicate)
[INFO] | +- .glassfish.jaxb:txw2:jar:2.3.9:compile
[INFO] | +- com.sun.istack:istack-commons-runtime:jar:3.0.12:compile
[INFO] | \- com.sun.activation:jakarta.activation:jar:1.2.2:runtime
[INFO] +- .junit.jupiter:junit-jupiter-api:jar:5.12.1:test
[INFO] | +- .opentest4j:opentest4j:jar:1.3.0:test
[INFO] | +- .junit.platform:junit-platform-commons:jar:1.12.1:test
[INFO] | | \- (.apiguardian:apiguardian-api:jar:1.1.2:test - omitted for duplicate)
[INFO] | \- .apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] +- .junit.jupiter:junit-jupiter-engine:jar:5.12.1:test
[INFO] | +- .junit.platform:junit-platform-engine:jar:1.12.1:test
[INFO] | | +- (.opentest4j:opentest4j:jar:1.3.0:test - omitted for duplicate)
[INFO] | | +- (.junit.platform:junit-platform-commons:jar:1.12.1:test - omitted for duplicate)
[INFO] | | \- (.apiguardian:apiguardian-api:jar:1.1.2:test - omitted for duplicate)
[INFO] | +- (.junit.jupiter:junit-jupiter-api:jar:5.12.1:test - omitted for duplicate)
[INFO] | \- (.apiguardian:apiguardian-api:jar:1.1.2:test - omitted for duplicate)
[INFO] \- .apachemons:commons-lang3:jar:3.17.0:compile
Turning back to junit-jupiter 5.11.4
everything works fine. My java version is currently 1.8.0_302
; my maven version is 3.9.9
Furthermore, based on 5.11.4
all test classes are collected, so I think the naming convention of class names should be correct.
Can anyone give me any advice, how to get rid of this problem? I know, there are many similar issues with this message - but I dont see any conflict here...
While updating junit from 5.11.4
to 5.12.1
my Java Program failes to perform tests with the following exception:
Mär 31, 2025 1:34:48 PM .junit.platform.launcher.core.DefaultLauncher handleThrowable
WARNUNG: TestEngine with ID 'junit-jupiter' failed to discover tests
.junit.platformmons.JUnitException: OutputDirectoryProvider not available; probably due to unaligned versions of the junit-platform-engine and junit-platform-launcher jars on the classpath/module path.
at .junit.platform.engine.EngineDiscoveryRequest.getOutputDirectoryProvider(EngineDiscoveryRequest.java:94)
at .junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:67)
at .junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot(DefaultLauncher.java:168)
at .junit.platform.launcher.core.DefaultLauncher.discoverRoot(DefaultLauncher.java:155)
at .junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:120)
at .apache.maven.surefire.junitplatform.TestPlanScannerFilter.accept(TestPlanScannerFilter.java:56)
at .apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:102)
at .apache.maven.surefire.junitplatform.JUnitPlatformProvider.scanClasspath(JUnitPlatformProvider.java:143)
at .apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124)
at .apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
at .apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
at .apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
at .apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
My pom.xml includes the following dependencies:
<dependency>
<groupId>.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.12.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.12.1</version>
<scope>test</scope>
</dependency>
maven-surefire-plugin
and maven-failsafe-plugin
are integrated as a plugin with version 2.22.2
.
Even creating the dependency tree with maven, I dont see any conflicts concerning junit-jupiter:
[INFO] +- .slf4j:slf4j-api:jar:2.0.17:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.3.15:compile
[INFO] | +- (ch.qos.logback:logback-core:jar:1.3.15:compile - omitted for duplicate)
[INFO] | \- (.slf4j:slf4j-api:jar:2.0.7:compile - omitted for conflict with 2.0.17)
[INFO] +- ch.qos.logback:logback-core:jar:1.3.15:compile
[INFO] +- .projectlombok:lombok:jar:1.18.36:provided
[INFO] +- .apache.maven.plugins:maven-compiler-plugin:jar:3.14.0:compile
[INFO] | +- .apache.maven.shared:maven-shared-utils:jar:3.4.2:compile
[INFO] | | +- (.slf4j:slf4j-api:jar:1.7.36:compile - omitted for conflict with 2.0.17)
[INFO] | | \- commons-io:commons-io:jar:2.11.0:compile
[INFO] | +- .apache.maven.shared:maven-shared-incremental:jar:1.1:compile
[INFO] | +- .codehaus.plexus:plexus-java:jar:1.4.0:compile
[INFO] | | +- .ow2.asm:asm:jar:9.7.1:compile
[INFO] | | \- com.thoughtworks.qdox:qdox:jar:2.2.0:compile
[INFO] | +- .codehaus.plexus:plexus-compiler-api:jar:2.15.0:compile
[INFO] | | +- (.codehaus.plexus:plexus-utils:jar:4.0.0:compile - omitted for conflict with 4.0.1)
[INFO] | | \- (.slf4j:slf4j-api:jar:1.7.36:compile - omitted for conflict with 2.0.17)
[INFO] | +- .codehaus.plexus:plexus-compiler-manager:jar:2.15.0:compile
[INFO] | | +- (.codehaus.plexus:plexus-compiler-api:jar:2.15.0:compile - omitted for duplicate)
[INFO] | | +- javax.inject:javax.inject:jar:1:compile
[INFO] | | +- (.slf4j:slf4j-api:jar:1.7.36:compile - omitted for conflict with 2.0.17)
[INFO] | | \- .codehaus.plexus:plexus-xml:jar:3.0.0:compile
[INFO] | +- .codehaus.plexus:plexus-compiler-javac:jar:2.15.0:runtime
[INFO] | | +- (.codehaus.plexus:plexus-utils:jar:4.0.0:runtime - omitted for conflict with 4.0.1)
[INFO] | | +- (javax.inject:javax.inject:jar:1:runtime - omitted for duplicate)
[INFO] | | +- (.slf4j:slf4j-api:jar:1.7.36:runtime - omitted for conflict with 2.0.17)
[INFO] | | \- (.codehaus.plexus:plexus-compiler-api:jar:2.15.0:runtime - omitted for duplicate)
[INFO] | \- .codehaus.plexus:plexus-utils:jar:4.0.1:compile
[INFO] +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] | \- jakarta.activation:jakarta.activation-api:jar:1.2.2:compile
[INFO] +- javax.activation:activation:jar:1.1:compile
[INFO] +- .glassfish.jaxb:jaxb-runtime:jar:2.3.9:compile
[INFO] | +- (jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile - omitted for duplicate)
[INFO] | +- .glassfish.jaxb:txw2:jar:2.3.9:compile
[INFO] | +- com.sun.istack:istack-commons-runtime:jar:3.0.12:compile
[INFO] | \- com.sun.activation:jakarta.activation:jar:1.2.2:runtime
[INFO] +- .junit.jupiter:junit-jupiter-api:jar:5.12.1:test
[INFO] | +- .opentest4j:opentest4j:jar:1.3.0:test
[INFO] | +- .junit.platform:junit-platform-commons:jar:1.12.1:test
[INFO] | | \- (.apiguardian:apiguardian-api:jar:1.1.2:test - omitted for duplicate)
[INFO] | \- .apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] +- .junit.jupiter:junit-jupiter-engine:jar:5.12.1:test
[INFO] | +- .junit.platform:junit-platform-engine:jar:1.12.1:test
[INFO] | | +- (.opentest4j:opentest4j:jar:1.3.0:test - omitted for duplicate)
[INFO] | | +- (.junit.platform:junit-platform-commons:jar:1.12.1:test - omitted for duplicate)
[INFO] | | \- (.apiguardian:apiguardian-api:jar:1.1.2:test - omitted for duplicate)
[INFO] | +- (.junit.jupiter:junit-jupiter-api:jar:5.12.1:test - omitted for duplicate)
[INFO] | \- (.apiguardian:apiguardian-api:jar:1.1.2:test - omitted for duplicate)
[INFO] \- .apachemons:commons-lang3:jar:3.17.0:compile
Turning back to junit-jupiter 5.11.4
everything works fine. My java version is currently 1.8.0_302
; my maven version is 3.9.9
Furthermore, based on 5.11.4
all test classes are collected, so I think the naming convention of class names should be correct.
Can anyone give me any advice, how to get rid of this problem? I know, there are many similar issues with this message - but I dont see any conflict here...
Share Improve this question edited Apr 1 at 7:21 Alex asked Mar 31 at 14:06 AlexAlex 1832 silver badges18 bronze badges 4 |1 Answer
Reset to default 1The solution was to add the following dependency:
<dependency>
<groupId>.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.12.1</version>
<scope>test</scope>
</dependency>
Reference
.m2
folder ? – Aserre Commented Mar 31 at 14:11mvn clean
, but this did not help. I can switch between 5.11.4 and 5.12.1. I can reproduce it every time. I have to follow the approach to delete .m2-dir later... – Alex Commented Mar 31 at 14:17