quarkusio/quarkus · error · DeploymentInjectionException

Failed to resolve descriptor for ${artifact}

Error message

Failed to resolve descriptor for ${artifact}

What it means

Thrown when resolver.resolveDescriptor() fails to fetch and parse the effective POM (artifact descriptor) for the target artifact while building a CollectRequest in getCollectRequest(). Quarkus needs the descriptor to merge its managed dependencies with the platform's dependencyManagement before collecting the graph. A BootstrapMavenException from descriptor resolution (POM not found, unreadable, or invalid) is rewrapped as this DeploymentInjectionException.

Source

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

            root = resolver.getSystem()
                    .collectDependencies(resolver.getSession(), collectRequest)
                    .getRoot();
        } catch (DependencyCollectionException e) {
            throw new DeploymentInjectionException("Failed to collect dependencies for " + artifact, e);
        }
        if (root.getChildren().size() != 1) {
            throw new DeploymentInjectionException("Only one child expected but got " + root.getChildren());
        }
        return root.getChildren().get(0);
    }

    private CollectRequest getCollectRequest(Artifact artifact, Collection<Exclusion> exclusions,
            List<RemoteRepository> repos) {
        final ArtifactDescriptorResult descr;
        try {
            descr = resolver.resolveDescriptor(artifact, repos);
        } catch (BootstrapMavenException e) {
            throw new DeploymentInjectionException("Failed to resolve descriptor for " + artifact, e);
        }
        final List<Dependency> effectiveConstraints;
        if (descr.getManagedDependencies().isEmpty()) {
            effectiveConstraints = new ArrayList<>(managedDeps.values());
        } else {
            final Map<ArtifactKey, Dependency> effecctiveMap = new HashMap<>(managedDeps);
            DependencyUtils.putAll(effecctiveMap, descr.getManagedDependencies());
            effectiveConstraints = new ArrayList<>(effecctiveMap.values());
        }
        return new CollectRequest()
                .setManagedDependencies(effectiveConstraints)
                .setRepositories(repos)
                // formal root artifact
                .setRootArtifact(new DefaultArtifact("io.quarkus", "quarkus-root-artifact", ArtifactCoords.TYPE_JAR, "1.0"))
                .setDependencies(List.of(new Dependency(artifact, JavaScopes.COMPILE, false, exclusions)));
    }

    private Artifact resolve(Artifact artifact, List<RemoteRepository> repos) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Verify the exact coordinates exist: 'mvn dependency:get -Dartifact=g:a:v' — fix typos or wrong versions in the dependency declaration.
  2. Add the missing repository (settings.xml <repositories> or quarkus.maven.repo-local / quarkus repositories config) that hosts the artifact.
  3. Delete the artifact's directory under ~/.m2/repository and retry with -U to replace a corrupt POM.
  4. If it's a SNAPSHOT, confirm the snapshot repository is enabled with updatePolicy allowing re-resolution.

Example fix

// before: quarkus arguments pointing to an extension not in any configured repo
quarkus.args."--additional-extension"="com.acme:quarkus-acme:1.0"
// after: declare the repo in settings.xml so the descriptor can be resolved
<settings>
  <profiles>
    <profile>
      <repositories>
        <repository>
          <id>acme</id>
          <url>https://nexus.acme.com/repository/maven-releases/</url>
        </repository>
      </repositories>
    </profile>
  </profiles>
</settings>
Defensive patterns

Strategy: validation

Validate before calling

import static java.nio.file.Files.isReadable;
// sanity-check coordinates before passing to bootstrap APIs
static void validateCoords(String g, String a, String v) {
    if (g == null || g.isBlank() || a == null || a.isBlank() || v == null || v.isBlank())
        throw new IllegalArgumentException("incomplete coordinates: " + g + ":" + a + ":" + v);
}

Try / catch

try {
    resolver.resolve(descriptorRequest);
} catch (BootstrapMavenException e) {
    throw new IllegalStateException(
        "Descriptor for " + artifact + " unresolvable; check repo config and coordinates", e);
}

Prevention

When it happens

Trigger: ApplicationDependencyResolver.getCollectRequest(artifact, exclusions, repos) calls resolver.resolveDescriptor(artifact, repos) and the artifact's POM cannot be downloaded from the given repositories, does not exist at the coordinates, or is malformed XML.

Common situations: Typo in groupId:artifactId:version of an extension; artifact exists only in a repository not configured in settings.xml; partial download left an invalid POM in ~/.m2; a snapshot repository missing for a -SNAPSHOT version; POM parse failure due to unsupported features (e.g. exotic plugins in the POM build section).

Related errors


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