{"record":{"id":"e090050786b39470","repo":"junit-team/junit5","slug":"outputdirectorycreator-not-available-probably-due","errorCode":null,"errorMessage":"OutputDirectoryCreator not available; probably due to unaligned versions of the junit-platform-engine and junit-platform-launcher jars on the classpath/module path.","messagePattern":"OutputDirectoryCreator not available; probably due to unaligned versions of the junit-platform-engine and junit-platform-launcher jars on the classpath/module path\\.","errorType":"exception","errorClass":"JUnitException","httpStatus":null,"severity":"critical","filePath":"junit-platform-engine/src/main/java/org/junit/platform/engine/EngineDiscoveryRequest.java","lineNumber":112,"sourceCode":"\t * @since 1.12\n\t * @deprecated Please use {@link #getOutputDirectoryCreator()} instead\n\t */\n\t@SuppressWarnings(\"removal\")\n\t@Deprecated(since = \"1.14\", forRemoval = true)\n\t@API(status = DEPRECATED, since = \"1.14\")\n\tdefault org.junit.platform.engine.reporting.OutputDirectoryProvider getOutputDirectoryProvider() {\n\t\treturn org.junit.platform.engine.reporting.OutputDirectoryProvider.castOrAdapt(getOutputDirectoryCreator());\n\t}\n\n\t/**\n\t * Get the {@link OutputDirectoryCreator} for this request.\n\t *\n\t * @return the output directory creator; never {@code null}\n\t * @since 1.14\n\t */\n\t@API(status = MAINTAINED, since = \"1.14\")\n\tdefault OutputDirectoryCreator getOutputDirectoryCreator() {\n\t\tthrow new JUnitException(\n\t\t\t\"OutputDirectoryCreator not available; probably due to unaligned versions of the junit-platform-engine and junit-platform-launcher jars on the classpath/module path.\");\n\t}\n\n}\n","sourceCodeStart":94,"sourceCodeEnd":117,"githubUrl":"https://github.com/junit-team/junit5/blob/f070c699a08b5d8393df9afd147af5c5e90bb21b/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineDiscoveryRequest.java#L94-L117","documentation":"EngineDiscoveryRequest.getOutputDirectoryCreator() is a default method that throws unless the concrete implementation overrides it (the Launcher's request implementation does). The message indicates the engine jar on the runtime classpath/module path is newer than the launcher jar, so the launcher never supplied an overriding implementation. This is a version-alignment defect surfaced at discovery time.","triggerScenarios":"Mixing an older junit-platform-launcher jar with a newer junit-platform-engine jar (>=1.14) such that code calling getOutputDirectoryCreator() reaches the default throwing method. The launcher's internal EngineDiscoveryRequest implementation overrides this method; an older launcher lacks the override.","commonSituations":"Pulling in junit-platform-engine 1.14+ transitively while a build tool pins junit-platform-launcher to an older version; using junit-platform-console-standalone of one version plus explicit engine deps of another; misaligned BOM usage; IDE/Gradle dependency resolution resolving the engine and launcher to different versions.","solutions":["Align junit-platform-engine and junit-platform-launcher (and junit-platform-console) to the exact same version; use the junit-bom to keep them consistent.","Run 'gradle dependencies' / 'mvn dependency:tree' and look for different patch/minor versions of platform-engine vs platform-launcher.","If using the standalone console launcher, use the matching standalone jar version and do not add separate engine jars to the classpath.","After aligning, clean and rebuild to flush stale resolved versions."],"exampleFix":"// before (gradle) — mismatched\nimplementation 'org.junit.platform:junit-platform-engine:1.14.0'\nimplementation 'org.junit.platform:junit-platform-launcher:1.10.0'\n// after — align via BOM\nimplementation platform('org.junit.platform:junit-platform-bom:1.14.0')\nimplementation 'org.junit.platform:junit-platform-engine'\nimplementation 'org.junit.platform:junit-platform-launcher'","handlingStrategy":"validation","validationCode":"// At startup, verify engine and launcher versions match.\n// Simplest: resolve via the junit-bom and assert in tests:\nString engine = org.junit.platform.engine.EngineDiscoveryRequest.class.getPackage().getImplementationVersion();\nString launcher = org.junit.platform.launcher.Launcher.class.getPackage().getImplementationVersion();\nif (engine != null && launcher != null && !engine.equals(launcher))\n  throw new IllegalStateException(\"platform-engine \" + engine + \" != platform-launcher \" + launcher);\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always import the junit-platform-bom and let it pin all platform artifacts to one version.","Run 'gradle dependencies' / 'mvn dependency:tree' and confirm platform-* share one version.","Use the standalone console launcher jar of a single version rather than assembling individual platform jars."],"tags":["version-mismatch","engine","launcher","dependency-management","discovery"],"backgroundTag":null,"analyzedSha":"f070c699a08b5d8393df9afd147af5c5e90bb21b","analyzedAt":"2026-08-11T20:31:00.530Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}