quarkusio/quarkus · error · IllegalArgumentException

Failed to locate ${targetCoords.toCompactCoords()} among the

Error message

Failed to locate ${targetCoords.toCompactCoords()} among the dependencies

What it means

The Dev UI Dependencies processor resolves a user-selected artifact to its node in the resolved application model so dependents can be computed. getTargetWithAllDependents throws IllegalArgumentException when no resolved dependency in the ApplicationModel matches the target's group/artifact/type/version. The requested coordinate is not among the application's dependencies as resolved at build time.

Source

Thrown at extensions/devui/deployment/src/main/java/io/quarkus/devui/deployment/menu/DependenciesProcessor.java:345

        }
        collectAllPaths(node.dependents.get(0), currentPath, allPaths);
    }

    private static DepNode getTargetWithAllDependents(ArtifactCoords targetCoords, Map<ArtifactKey, DepNode> all) {
        DepNode targetDep = null;
        for (var d : all.values()) {
            d.initDependents(all);
            if (targetDep == null
                    && d.resolvedDep.getArtifactId().equals(targetCoords.getArtifactId())
                    && d.resolvedDep.getGroupId().equals(targetCoords.getGroupId())
                    && d.resolvedDep.getClassifier().equals(targetCoords.getClassifier())
                    && d.resolvedDep.getType().equals(targetCoords.getType())
                    && d.resolvedDep.getVersion().equals(targetCoords.getVersion())) {
                targetDep = d;
            }
        }
        if (targetDep == null) {
            throw new IllegalArgumentException(
                    "Failed to locate " + targetCoords.toCompactCoords() + " among the dependencies");
        }
        return targetDep;
    }

    private static Map<ArtifactKey, DepNode> getCompleteMap(ApplicationModel model) {
        var all = new HashMap<ArtifactKey, DepNode>();
        var root = new DepNode(0, model.getAppArtifact());
        all.put(model.getAppArtifact().getKey(), root);
        int i = 1;
        for (var d : model.getDependencies()) {
            all.put(d.getKey(), new DepNode(i++, d));
        }
        return all;
    }

    /**
     * Path from a target to the root

View on GitHub (pinned to e1c734241f)

Solutions

  1. Refresh the Dev UI dependencies page so it sends coordinates from the current application model.
  2. Verify the artifact/version exists in the build file (pom.xml/build.gradle) and matches the request exactly, including classifier and type.
  3. Reload/restart dev mode after dependency changes so the ApplicationModel is rebuilt.
  4. Check that you are passing the fully resolved version (not a property placeholder or wildcard).

Example fix

// before (stale coordinates from earlier model)
{"groupId":"com.example","artifactId":"lib","version":"1.0.0"}

// after (version actually resolved now)
{"groupId":"com.example","artifactId":"lib","version":"1.2.0"}
Defensive patterns

Strategy: validation

Validate before calling

boolean exists = model.getDependencies().stream().anyMatch(d ->
    d.getGroupId().equals(g) && d.getArtifactId().equals(a) &&
    d.getVersion().equals(v) && d.getType().equals(t));
if (!exists) throw new IllegalArgumentException("Unknown dependency: " + g + ":" + a + ":" + v);

Try / catch

try { DepNode dep = getTargetWithAllDependents(model, coords); ... }
catch (IllegalArgumentException e) {
    if (e.getMessage().contains("among the dependencies")) {
        refreshApplicationModelAndRetry(); // stale model, reload page
    } else throw e;
}

Prevention

When it happens

Trigger: Invoking the Dev UI dependencies action (e.g. 'show dependents' for an artifact) with coordinates that don't correspond exactly — G:A:classifier:type:version — to any node in the resolved dependency tree.

Common situations: Dev UI page stale after adding/removing a dependency (the app was hot-reloaded); a version was upgraded so the exact version string no longer matches; typos or a classifier/type mismatch in the request.

Related errors


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