{"record":{"id":"2f7364d4d54727af","repo":"apache/maven","slug":"plugin-plugin-getid-or-one-of-its-dependencie","errorCode":null,"errorMessage":"Plugin ${plugin.getId()} or one of its dependencies could not be resolved:\n\t${exceptionMessages}","messagePattern":"Plugin (.+?) or one of its dependencies could not be resolved:\n\t(.+?)","errorType":"exception","errorClass":"PluginManagerException","httpStatus":null,"severity":"error","filePath":"impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java","lineNumber":978,"sourceCode":"        if (plugin.getVersion() == null) {\n            PluginVersionRequest versionRequest = new DefaultPluginVersionRequest(plugin, session, repositories);\n            try {\n                plugin.setVersion(pluginVersionResolver.resolve(versionRequest).getVersion());\n            } catch (PluginVersionResolutionException e) {\n                throw new PluginManagerException(plugin, e.getMessage(), e);\n            }\n        }\n\n        // TODO: store plugin version\n\n        // resolve plugin artifacts\n        List<Artifact> artifacts;\n        PluginArtifactsCache.Key cacheKey = pluginArtifactsCache.createKey(plugin, null, repositories, session);\n        PluginArtifactsCache.CacheRecord recordArtifacts;\n        try {\n            recordArtifacts = pluginArtifactsCache.get(cacheKey);\n        } catch (PluginResolutionException e) {\n            throw new PluginManagerException(plugin, e.getMessage(), e);\n        }\n        if (recordArtifacts != null) {\n            artifacts = recordArtifacts.getArtifacts();\n        } else {\n            try {\n                artifacts = resolveExtensionArtifacts(plugin, repositories, session);\n                recordArtifacts = pluginArtifactsCache.put(cacheKey, artifacts);\n            } catch (PluginResolutionException e) {\n                pluginArtifactsCache.put(cacheKey, e);\n                pluginArtifactsCache.register(project, cacheKey, recordArtifacts);\n                throw new PluginManagerException(plugin, e.getMessage(), e);\n            }\n        }\n        pluginArtifactsCache.register(project, cacheKey, recordArtifacts);\n\n        // create and cache extensions realms\n        final ExtensionRealmCache.Key extensionKey = extensionRealmCache.createKey(artifacts);\n        extensionRecord = extensionRealmCache.get(extensionKey);","sourceCodeStart":960,"sourceCodeEnd":996,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java#L960-L996","documentation":"While setting up a project's plugin, the plugin-artifacts cache returned a previously recorded resolution failure for the same plugin+repositories key: an earlier attempt in this build already failed to resolve the plugin, and the cached PluginResolutionException is rethrown wrapped in PluginManagerException. The tab-indented lines under the message are the individual underlying exceptions (missing artifacts, transfer errors, ...), and the first one is the real cause.","triggerScenarios":"Multi-module build where one module fails to resolve the plugin and later modules touch the same plugin key; plugin artifact or one of its dependencies absent from every reachable repository; unreachable repository or 401 during the first resolution attempt.","commonSituations":"Plugin version referenced but never deployed (or deployed without its POM); internal repo not containing a third-party plugin; network/mirror outage during the first module's build; wrong credentials for a private repository.","solutions":["Read the indented exception list and fix the first concrete cause (usually a specific artifact or transfer error).","Confirm the plugin coordinates and version exist in a reachable repository (browse the repo manager or curl the artifact path).","Fix settings.xml credentials/mirrors for private repositories (401/403 in the exception text).","After fixing the cause, re-run the whole build — the failure cache lives in this session only.","If the artifact should exist, purge the local copy (rm -rf ~/.m2/repository/<group path>) and retry with -U."],"exampleFix":"// before: version referenced but never deployed to any reachable repository\n<plugin>\n  <groupId>org.example</groupId>\n  <artifactId>example-maven-plugin</artifactId>\n  <version>2.1.0</version>\n</plugin>\n\n// after: use a version that actually exists\n<plugin>\n  <groupId>org.example</groupId>\n  <artifactId>example-maven-plugin</artifactId>\n  <version>2.0.5</version>\n</plugin>","handlingStrategy":"try-catch","validationCode":"# pre-flight: prove every plugin (and its whole dependency set) resolves before the real build\nmvn -B dependency:resolve-plugins\n# surface which artifact URLs fail, if any\nmvn -X dependency:resolve-plugins 2>&1 | grep -B2 'Could not transfer\\|Could not find' | head -50","typeGuard":"static PluginResolutionException pluginResolutionCause(PluginManagerException e) {\n    for (Throwable c = e; c != null; c = c.getCause()) {\n        if (c instanceof PluginResolutionException pre) return pre;\n    }\n    return null;\n}","tryCatchPattern":"try {\n    setupPlugin(project, plugin, session);\n} catch (PluginManagerException e) {\n    PluginResolutionException pre = pluginResolutionCause(e);\n    if (pre != null) {\n        // message lines are one failure per artifact: fix the first, the rest usually follow\n        log.error('unresolvable plugin {}:{}: {}', plugin.getGroupId(), plugin.getArtifactId(), pre.getMessage());\n    }\n    throw e;\n}","preventionTips":["Warm CI caches with dependency:go-offline on a schedule so plugin availability is verified continuously.","Validate that every pinned plugin version is deployed to a repo all environments can reach.","Keep settings.xml server credentials for private repo managers current everywhere Maven runs.","Prefer released versions over internal SNAPSHOT plugins for reproducible builds."],"tags":["maven","plugin","artifact-resolution","repositories","cache"],"backgroundTag":"plugin-dependency-resolution-failed","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}