quarkusio/quarkus · error · MojoExecutionException

Failed to resolve dependencies of ${project.getArtifact()}

Error message

Failed to resolve dependencies of ${project.getArtifact()}

What it means

MojoExecutionException context in ExtensionDescriptorMojo: after reporting descriptor consistency problems (e.g. deployment artifacts whose runtime counterparts are missing from the dependencies of the extension being processed), the mojo fails dependency resolution of the project artifact. The message names the extension project artifact whose dependency tree could not be resolved.

Source

Thrown at independent-projects/extension-maven-plugin/src/main/java/io/quarkus/maven/ExtensionDescriptorMojo.java:994

                    log.error("The deployment artifact " + rootDeploymentGact
                            + " depends on the following Quarkus extension deployment artifacts whose corresponding runtime artifacts were not found among the dependencies of "
                            + project.getArtifact() + ":");
                    highlightInTree(deploymentNode, unexpectedDeploymentDeps);
                }
            }

            throw new MojoExecutionException(buf.toString());
        }

    }

    private DependencyResult resolveRuntimeDeps() throws MojoExecutionException {
        if (runtimeDeps == null) {
            try {
                runtimeDeps = repoSystem.resolveDependencies(repoSession,
                        new DependencyRequest().setCollectRequest(newCollectRuntimeDepsRequest()));
            } catch (Exception e) {
                throw new MojoExecutionException("Failed to resolve dependencies of " + project.getArtifact(), e);
            }
        }
        return runtimeDeps;
    }

    private void highlightInTree(DependencyNode node, Collection<ArtifactKey> keys) {
        highlightInTree(0, node, keys, new HashSet<>(), new StringBuilder(), new ArrayList<>());
    }

    private void highlightInTree(int depth, DependencyNode node, Collection<ArtifactKey> keysToHighlight,
            Set<ArtifactKey> visited, StringBuilder buf, List<String> branch) {
        final ArtifactKey key = toKey(node.getArtifact());
        if (!visited.add(key)) {
            return;
        }
        buf.setLength(0);
        final boolean highlighted = keysToHighlight.contains(key);
        if (highlighted) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Run mvn -U to force refresh of snapshots/metadata
  2. Add the missing <repository> to pom.xml or settings.xml
  3. Run offline=false and inspect the wrapped cause for the exact missing artifact
  4. Fix dependency conflicts using dependencyManagement or mvn dependency:tree -Dverbose

Example fix

<!-- before: repo missing -->
<!-- after -->
<repositories>
  <repository>
    <id>my-repo</id>
    <url>https://example.com/maven</url>
  </repository>
</repositories>
Defensive patterns

Strategy: retry

Validate before calling

mvn -U dependency:resolve

Try / catch

try {
  mojo.execute();
} catch (MojoExecutionException e) {
  if (e.getMessage().contains("Failed to resolve dependencies of")) {
    // refresh metadata / check repos and retry
  }
}

Prevention

When it happens

Trigger: DependencyRequest resolution fails: missing artifacts, repository outage, conflicting versions with no resolution, or invalid dependency metadata when resolveRuntimeDeps() is first called.

Common situations: Unresolvable snapshots; missing repositories for a third-party dependency; offline builds without cached artifacts; version conflicts making resolution impossible.

Related errors


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