{"record":{"id":"e327743041989029","repo":"quarkusio/quarkus","slug":"failed-to-resolve-dependencies-for-maven-plugin","errorCode":null,"errorMessage":"Failed to resolve dependencies for Maven plugin ${pluginArtifact}","messagePattern":"Failed to resolve dependencies for Maven plugin (.+?)","errorType":"exception","errorClass":"BootstrapMavenException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenArtifactResolver.java","lineNumber":274,"sourceCode":"\n    public DependencyResult resolveDependencies(Artifact artifact, List<Dependency> deps, List<RemoteRepository> mainRepos)\n            throws BootstrapMavenException {\n        final CollectRequest request = newCollectRequest(artifact, mainRepos);\n        request.setDependencies(deps);\n        try {\n            return repoSystem.resolveDependencies(repoSession,\n                    new DependencyRequest().setCollectRequest(request));\n        } catch (DependencyResolutionException e) {\n            throw new BootstrapMavenException(\"Failed to resolve dependencies for \" + artifact, e);\n        }\n    }\n\n    public DependencyResult resolvePluginDependencies(Artifact pluginArtifact) throws BootstrapMavenException {\n        try {\n            return repoSystem.resolveDependencies(repoSession, new DependencyRequest().setCollectRequest(new CollectRequest()\n                    .setRoot(new Dependency(pluginArtifact, null)).setRepositories(context.getRemotePluginRepositories())));\n        } catch (DependencyResolutionException e) {\n            throw new BootstrapMavenException(\"Failed to resolve dependencies for Maven plugin \" + pluginArtifact, e);\n        }\n    }\n\n    /**\n     * Turns the list of dependencies into a simple dependency tree\n     */\n    public DependencyResult toDependencyTree(List<Dependency> deps, List<RemoteRepository> mainRepos)\n            throws BootstrapMavenException {\n        DependencyResult result = new DependencyResult(\n                new DependencyRequest().setCollectRequest(new CollectRequest(deps, List.of(), mainRepos)));\n        DefaultDependencyNode root = new DefaultDependencyNode((Dependency) null);\n        result.setRoot(root);\n        GenericVersionScheme vs = new GenericVersionScheme();\n        for (Dependency i : deps) {\n            DefaultDependencyNode node = new DefaultDependencyNode(i);\n            try {\n                node.setVersionConstraint(vs.parseVersionConstraint(i.getArtifact().getVersion()));\n                node.setVersion(vs.parseVersion(i.getArtifact().getVersion()));","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenArtifactResolver.java#L256-L292","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the wrapped DependencyResolutionException for the missing plugin artifact","Add the repository hosting the plugin to pluginRepositories in settings.xml/pom","Verify the plugin GAV and version exist (search Central or the vendor repo)","Run online (remove offline flags) so plugin artifacts can be downloaded and cached"],"exampleFix":"// before\nresolver.resolvePluginDependencies(new DefaultArtifact(\"org.example\",\"custom-plugin\",null,\"jar\",\"1.0\"));\n// after: ensure repo configured in ~/.m2/settings.xml <pluginRepositories> first\nresolver.resolvePluginDependencies(new DefaultArtifact(\"org.example\",\"custom-plugin\",null,\"jar\",\"1.0.0\"));","handlingStrategy":"validation","validationCode":"// plugin repos must host the plugin — verify via a version-range probe first\nresolver.resolveVersionRange(new DefaultArtifact(\n    pluginArtifact.getGroupId(), pluginArtifact.getArtifactId(), null,\n    pluginArtifact.getExtension(), \"[0,)\"));","typeGuard":null,"tryCatchPattern":"try {\n    resolver.resolvePluginDependencies(pluginArtifact);\n} catch (BootstrapMavenException e) {\n    log.error(\"Plugin \" + pluginArtifact + \" unresolvable; check pluginRepositories. Cause: \" + e.getCause());\n}","preventionTips":["Declare <pluginRepositories> for any non-Central plugin sources (internal tooling repos)","Pin exact plugin versions; avoid dead historic plugin coordinates","Pre-download plugins in CI images so offline builds work","Verify plugin GAV on Maven Central before introducing it"],"tags":["maven","plugin","dependency-resolution"],"backgroundTag":"plugin-dependency-resolution-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}