{"record":{"id":"28692ad882258219","repo":"quarkusio/quarkus","slug":"dependency-node-has-already-been-associated-with-28692a","errorCode":null,"errorMessage":"Dependency node  has already been associated with an extension dependency","messagePattern":"Dependency node  has already been associated with an extension dependency","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/ApplicationDependencyTreeResolver.java","lineNumber":763,"sourceCode":"\n        final ExtensionInfo info;\n        final DependencyNode runtimeNode;\n        final Collection<Exclusion> exclusions;\n        boolean conditionalDepsQueued;\n        private List<ExtensionDependency> extDeps;\n        private boolean presentInTargetGraph;\n\n        private ExtensionDependency(ExtensionInfo info, DependencyNode node, Collection<Exclusion> exclusions) {\n            this.runtimeNode = node;\n            this.info = info;\n            this.exclusions = exclusions;\n\n            @SuppressWarnings(\"unchecked\")\n            final Map<Object, Object> data = (Map<Object, Object>) node.getData();\n            if (data.isEmpty()) {\n                node.setData(QUARKUS_EXTENSION_DEPENDENCY, this);\n            } else if (data.put(QUARKUS_EXTENSION_DEPENDENCY, this) != null) {\n                throw new IllegalStateException(\n                        \"Dependency node \" + node + \" has already been associated with an extension dependency\");\n            }\n        }\n\n        private void addExtensionDependency(ExtensionDependency dep) {\n            if (extDeps == null) {\n                extDeps = new ArrayList<>();\n            }\n            extDeps.add(dep);\n        }\n\n        private void replaceRuntimeExtensionNodes(DependencyNode deploymentNode) {\n            var deploymentVisitor = new OrderedDependencyVisitor(deploymentNode);\n            // skip the root node\n            deploymentVisitor.next();\n            int nodesToReplace = extDeps == null ? 1 : extDeps.size() + 1;\n            while (deploymentVisitor.hasNext() && nodesToReplace > 0) {\n                deploymentVisitor.next();","sourceCodeStart":745,"sourceCodeEnd":781,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/ApplicationDependencyTreeResolver.java#L745-L781","documentation":"An IllegalStateException thrown by ExtensionDependency's node-marking logic: when attaching a QUARKUS_EXTENSION_DEPENDENCY data key to a dependency node, the node already carries different data, and re-putting the key returned a previous value — meaning the same node was claimed by two extension dependencies. Quarkus guards against ambiguous extension association.","triggerScenarios":"During tree walking/injection, the same dependency node is encountered twice and both times an ExtensionDependency tries to write itself into node data with non-empty existing data; e.g. duplicated extension nodes from exotic dependency graph shapes or re-entrant resolution.","commonSituations":"Dependency cycles involving extensions; the same extension appearing via multiple paths with conflicting metadata; custom code reusing/mutating resolved nodes across resolutions; Quarkus bugs in node replacement.","solutions":["Inspect the node string in the message to identify the duplicate extension/artifact and remove the duplicate/conflicting dependency declaration","Check for dependency cycles or duplicated extension declarations with different versions in the POM","Upgrade Quarkus — this invariant can be broken by resolver bugs fixed in later versions","If triggered by custom tooling, do not reuse or mutate dependency nodes between resolution runs"],"exampleFix":"// before: same extension declared twice with different versions\n<dependency>com.acme:acme-ext:1.0.0</dependency>\n<dependency>com.acme:acme-ext:1.1.0</dependency>\n// after: single managed version\n<dependencyManagement> pins acme-ext to 1.1.0; one declaration</dependencyManagement>","handlingStrategy":"validation","validationCode":"// Detect duplicate extension declarations with differing versions before resolution\n// mvn dependency:tree -Dverbose | grep -i 'quarkus-extension' | sort | uniq -d","typeGuard":null,"tryCatchPattern":"try {\n    resolver.resolve();\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"has already been associated with an extension dependency\")) {\n        log.error(\"Duplicate/conflicting extension node detected: \" + e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Declare each extension once; manage versions via a single BOM","Avoid dependency cycles between custom extensions","Do not mutate or reuse resolved dependency nodes across resolution runs","Upgrade Quarkus if this occurs on a standard dependency graph (possible resolver bug)"],"tags":["quarkus-extensions","dependency-graph","state-conflict"],"backgroundTag":"dependency-node-state-conflict","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}