quarkusio/quarkus · error · IllegalStateException

Dependency node has already been associated with an extensi

Error message

Dependency node  has already been associated with an extension dependency

What it means

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.

Source

Thrown at independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/ApplicationDependencyTreeResolver.java:763

        final ExtensionInfo info;
        final DependencyNode runtimeNode;
        final Collection<Exclusion> exclusions;
        boolean conditionalDepsQueued;
        private List<ExtensionDependency> extDeps;
        private boolean presentInTargetGraph;

        private ExtensionDependency(ExtensionInfo info, DependencyNode node, Collection<Exclusion> exclusions) {
            this.runtimeNode = node;
            this.info = info;
            this.exclusions = exclusions;

            @SuppressWarnings("unchecked")
            final Map<Object, Object> data = (Map<Object, Object>) node.getData();
            if (data.isEmpty()) {
                node.setData(QUARKUS_EXTENSION_DEPENDENCY, this);
            } else if (data.put(QUARKUS_EXTENSION_DEPENDENCY, this) != null) {
                throw new IllegalStateException(
                        "Dependency node " + node + " has already been associated with an extension dependency");
            }
        }

        private void addExtensionDependency(ExtensionDependency dep) {
            if (extDeps == null) {
                extDeps = new ArrayList<>();
            }
            extDeps.add(dep);
        }

        private void replaceRuntimeExtensionNodes(DependencyNode deploymentNode) {
            var deploymentVisitor = new OrderedDependencyVisitor(deploymentNode);
            // skip the root node
            deploymentVisitor.next();
            int nodesToReplace = extDeps == null ? 1 : extDeps.size() + 1;
            while (deploymentVisitor.hasNext() && nodesToReplace > 0) {
                deploymentVisitor.next();

View on GitHub (pinned to e1c734241f)

Solutions

  1. Inspect the node string in the message to identify the duplicate extension/artifact and remove the duplicate/conflicting dependency declaration
  2. Check for dependency cycles or duplicated extension declarations with different versions in the POM
  3. Upgrade Quarkus — this invariant can be broken by resolver bugs fixed in later versions
  4. If triggered by custom tooling, do not reuse or mutate dependency nodes between resolution runs

Example fix

// before: same extension declared twice with different versions
<dependency>com.acme:acme-ext:1.0.0</dependency>
<dependency>com.acme:acme-ext:1.1.0</dependency>
// after: single managed version
<dependencyManagement> pins acme-ext to 1.1.0; one declaration</dependencyManagement>
Defensive patterns

Strategy: validation

Validate before calling

// Detect duplicate extension declarations with differing versions before resolution
// mvn dependency:tree -Dverbose | grep -i 'quarkus-extension' | sort | uniq -d

Try / catch

try {
    resolver.resolve();
} catch (IllegalStateException e) {
    if (e.getMessage().contains("has already been associated with an extension dependency")) {
        log.error("Duplicate/conflicting extension node detected: " + e.getMessage());
    }
    throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/28692ad882258219. Report an issue: GitHub.