{"record":{"id":"d51cb5a6bc4a199c","repo":"quarkusio/quarkus","slug":"quarkus-extension-deployment-artifact-does-not-ap","errorCode":null,"errorMessage":"Quarkus extension deployment artifact  does not appear to depend on the corresponding runtime artifact ","messagePattern":"Quarkus extension deployment artifact  does not appear to depend on the corresponding runtime artifact ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/ApplicationDependencyResolver.java","lineNumber":1009,"sourceCode":"            extDeps.add(dep);\n        }\n\n        private void collectDeploymentDeps() {\n            log.debugf(\"Collecting dependencies of %s\", info.deploymentArtifact);\n            deploymentNode = collectDependencies(info.deploymentArtifact, exclusions, runtimeNode.getRepositories());\n            if (deploymentNode.getChildren().isEmpty()) {\n                throw new RuntimeException(\n                        \"Failed to collect dependencies of \" + deploymentNode.getArtifact()\n                                + \": either its POM could not be resolved from the available Maven repositories \"\n                                + \"or the artifact does not have any dependencies while at least a dependency on the runtime artifact \"\n                                + info.runtimeArtifact + \" is expected\");\n            }\n            ensureScopeAndOptionality(deploymentNode, runtimeNode.getDependency().getScope(),\n                    runtimeNode.getDependency().isOptional());\n\n            replaceRuntimeExtensionNodes(deploymentNode);\n            if (!presentInTargetGraph) {\n                throw new RuntimeException(\n                        \"Quarkus extension deployment artifact \" + deploymentNode.getArtifact()\n                                + \" does not appear to depend on the corresponding runtime artifact \"\n                                + info.runtimeArtifact);\n            }\n        }\n\n        private void injectDeploymentDependency(AppDep parent) {\n            // if the parent is an extension then add the deployment node as a dependency of the parent's deployment node\n            // (that would happen when injecting conditional dependencies)\n            // otherwise, the runtime module is going to be replaced with the deployment node\n            final DependencyNode parentDeploymentNode = parent == null ? null\n                    : (parent.ext == null ? null : parent.ext.deploymentNode);\n            if (parentDeploymentNode == null) {\n                runtimeNode.setData(QUARKUS_RUNTIME_ARTIFACT, runtimeNode.getArtifact());\n                runtimeNode.setArtifact(deploymentNode.getArtifact());\n                runtimeNode.setChildren(deploymentNode.getChildren());\n                if (parent != null) {\n                    dependencyMap.getOrCreate(parent.node.getArtifact()).putDependency(deploymentNode.getDependency());","sourceCodeStart":991,"sourceCodeEnd":1027,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/ApplicationDependencyResolver.java#L991-L1027","documentation":"After injecting the deployment artifact's dependency graph, Quarkus verifies the deployment's dependency on the corresponding runtime artifact survived resolution (presentInTargetGraph, set during replaceRuntimeExtensionNodes). If the runtime artifact node was not found among the deployment's dependencies, this RuntimeException is thrown — meaning the deployment artifact does not actually (transitively, in scope, non-conflicted) depend on its runtime counterpart.","triggerScenarios":"collectDeploymentDeps() calls replaceRuntimeExtensionNodes(deploymentNode); if no node in the deployment graph matched the runtime artifact's key, presentInTargetGraph stays false and the error is thrown for the deployment artifact / runtime artifact pair.","commonSituations":"A custom deployment POM declaring the runtime dependency as optional, provided-scope filtered out, or with a different version excluded by dependencyManagement conflict rules; the runtime artifact excluded via Maven <exclusions>; version mismatch resolved to a different coordinate than info.runtimeArtifact.","solutions":["Inspect the deployment POM: ensure the runtime artifact is a direct, non-optional, compile-scope dependency without exclusions.","Run 'mvn dependency:tree -f <deployment-pom>' and confirm the runtime artifact appears; fix exclusion/scope/version if missing.","Check dependencyManagement/imported BOMs for a managed version of the runtime artifact that conflicts with the one Quarkus expects; align versions.","If using a locally-built extension, mvn install both runtime and deployment modules at the same version so they resolve consistently."],"exampleFix":"<!-- before: runtime dep marked optional -->\n<dependency>\n  <groupId>com.acme</groupId>\n  <artifactId>myext</artifactId>\n  <optional>true</optional>\n</dependency>\n<!-- after: mandatory runtime dependency -->\n<dependency>\n  <groupId>com.acme</groupId>\n  <artifactId>myext</artifactId>\n</dependency>","handlingStrategy":"validation","validationCode":"// verify runtime artifact present in deployment module's tree before building\nProcess p = new ProcessBuilder(\"mvn\", \"-f\", \"myext-deployment/pom.xml\",\n    \"dependency:tree\").inheritIO().start();\np.waitFor();\n// grep output for the runtime artifactId 'myext' (non-optional, present)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the runtime dependency on the runtime artifact direct, compile-scoped, and non-optional in the deployment POM.","Never exclude the runtime artifact in the deployment module's <exclusions>.","Align runtime/deployment versions (build and install both modules together).","Check BOM dependencyManagement for conflicting managed versions of the runtime artifact."],"tags":["quarkus-extension","dependency-graph","version-conflict"],"backgroundTag":"extension-runtime-deployment-mismatch","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}