quarkusio/quarkus · error · BootstrapMavenException

Failed to resolve dependencies for Maven plugin ${pluginArti

Error message

Failed to resolve dependencies for Maven plugin ${pluginArtifact}

What it means

resolvePluginDependencies(Artifact) resolves a Maven build plugin's dependency tree using the plugin repositories from the bootstrap Maven context (not the ordinary dependency repositories). Failure is wrapped as 'Failed to resolve dependencies for Maven plugin <gav>'. It is thrown when the plugin artifact or its dependencies cannot be resolved from the configured plugin repositories.

Source

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

    public DependencyResult resolveDependencies(Artifact artifact, List<Dependency> deps, List<RemoteRepository> mainRepos)
            throws BootstrapMavenException {
        final CollectRequest request = newCollectRequest(artifact, mainRepos);
        request.setDependencies(deps);
        try {
            return repoSystem.resolveDependencies(repoSession,
                    new DependencyRequest().setCollectRequest(request));
        } catch (DependencyResolutionException e) {
            throw new BootstrapMavenException("Failed to resolve dependencies for " + artifact, e);
        }
    }

    public DependencyResult resolvePluginDependencies(Artifact pluginArtifact) throws BootstrapMavenException {
        try {
            return repoSystem.resolveDependencies(repoSession, new DependencyRequest().setCollectRequest(new CollectRequest()
                    .setRoot(new Dependency(pluginArtifact, null)).setRepositories(context.getRemotePluginRepositories())));
        } catch (DependencyResolutionException e) {
            throw new BootstrapMavenException("Failed to resolve dependencies for Maven plugin " + pluginArtifact, e);
        }
    }

    /**
     * Turns the list of dependencies into a simple dependency tree
     */
    public DependencyResult toDependencyTree(List<Dependency> deps, List<RemoteRepository> mainRepos)
            throws BootstrapMavenException {
        DependencyResult result = new DependencyResult(
                new DependencyRequest().setCollectRequest(new CollectRequest(deps, List.of(), mainRepos)));
        DefaultDependencyNode root = new DefaultDependencyNode((Dependency) null);
        result.setRoot(root);
        GenericVersionScheme vs = new GenericVersionScheme();
        for (Dependency i : deps) {
            DefaultDependencyNode node = new DefaultDependencyNode(i);
            try {
                node.setVersionConstraint(vs.parseVersionConstraint(i.getArtifact().getVersion()));
                node.setVersion(vs.parseVersion(i.getArtifact().getVersion()));

View on GitHub (pinned to e1c734241f)

Solutions

  1. Check the wrapped DependencyResolutionException for the missing plugin artifact
  2. Add the repository hosting the plugin to pluginRepositories in settings.xml/pom
  3. Verify the plugin GAV and version exist (search Central or the vendor repo)
  4. Run online (remove offline flags) so plugin artifacts can be downloaded and cached

Example fix

// before
resolver.resolvePluginDependencies(new DefaultArtifact("org.example","custom-plugin",null,"jar","1.0"));
// after: ensure repo configured in ~/.m2/settings.xml <pluginRepositories> first
resolver.resolvePluginDependencies(new DefaultArtifact("org.example","custom-plugin",null,"jar","1.0.0"));
Defensive patterns

Strategy: validation

Validate before calling

// plugin repos must host the plugin — verify via a version-range probe first
resolver.resolveVersionRange(new DefaultArtifact(
    pluginArtifact.getGroupId(), pluginArtifact.getArtifactId(), null,
    pluginArtifact.getExtension(), "[0,)"));

Try / catch

try {
    resolver.resolvePluginDependencies(pluginArtifact);
} catch (BootstrapMavenException e) {
    log.error("Plugin " + pluginArtifact + " unresolvable; check pluginRepositories. Cause: " + e.getCause());
}

Prevention

When it happens

Trigger: Calling resolvePluginDependencies for a plugin that is not present in any configured plugin repository; plugin version doesn't exist; plugin repos (context.getRemotePluginRepositories()) don't include the host repository.

Common situations: Using an internal/company Maven plugin without adding its repository; typo in plugin artifactId or version; plugin removed or relocated (e.g. old Codehaus plugins); offline environment without cached plugin artifacts.

Related errors


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