apache/maven · error · PluginManagerException

Plugin ${plugin.getId()} or one of its dependencies could no

Error message

Plugin ${plugin.getId()} or one of its dependencies could not be resolved:
	${exceptionMessages}

What it means

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.

Source

Thrown at impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java:978

        if (plugin.getVersion() == null) {
            PluginVersionRequest versionRequest = new DefaultPluginVersionRequest(plugin, session, repositories);
            try {
                plugin.setVersion(pluginVersionResolver.resolve(versionRequest).getVersion());
            } catch (PluginVersionResolutionException e) {
                throw new PluginManagerException(plugin, e.getMessage(), e);
            }
        }

        // TODO: store plugin version

        // resolve plugin artifacts
        List<Artifact> artifacts;
        PluginArtifactsCache.Key cacheKey = pluginArtifactsCache.createKey(plugin, null, repositories, session);
        PluginArtifactsCache.CacheRecord recordArtifacts;
        try {
            recordArtifacts = pluginArtifactsCache.get(cacheKey);
        } catch (PluginResolutionException e) {
            throw new PluginManagerException(plugin, e.getMessage(), e);
        }
        if (recordArtifacts != null) {
            artifacts = recordArtifacts.getArtifacts();
        } else {
            try {
                artifacts = resolveExtensionArtifacts(plugin, repositories, session);
                recordArtifacts = pluginArtifactsCache.put(cacheKey, artifacts);
            } catch (PluginResolutionException e) {
                pluginArtifactsCache.put(cacheKey, e);
                pluginArtifactsCache.register(project, cacheKey, recordArtifacts);
                throw new PluginManagerException(plugin, e.getMessage(), e);
            }
        }
        pluginArtifactsCache.register(project, cacheKey, recordArtifacts);

        // create and cache extensions realms
        final ExtensionRealmCache.Key extensionKey = extensionRealmCache.createKey(artifacts);
        extensionRecord = extensionRealmCache.get(extensionKey);

View on GitHub (pinned to e4093d4e12)

Solutions

  1. Read the indented exception list and fix the first concrete cause (usually a specific artifact or transfer error).
  2. Confirm the plugin coordinates and version exist in a reachable repository (browse the repo manager or curl the artifact path).
  3. Fix settings.xml credentials/mirrors for private repositories (401/403 in the exception text).
  4. After fixing the cause, re-run the whole build — the failure cache lives in this session only.
  5. If the artifact should exist, purge the local copy (rm -rf ~/.m2/repository/<group path>) and retry with -U.

Example fix

// before: version referenced but never deployed to any reachable repository
<plugin>
  <groupId>org.example</groupId>
  <artifactId>example-maven-plugin</artifactId>
  <version>2.1.0</version>
</plugin>

// after: use a version that actually exists
<plugin>
  <groupId>org.example</groupId>
  <artifactId>example-maven-plugin</artifactId>
  <version>2.0.5</version>
</plugin>
Defensive patterns

Strategy: try-catch

Validate before calling

# pre-flight: prove every plugin (and its whole dependency set) resolves before the real build
mvn -B dependency:resolve-plugins
# surface which artifact URLs fail, if any
mvn -X dependency:resolve-plugins 2>&1 | grep -B2 'Could not transfer\|Could not find' | head -50

Type guard

static PluginResolutionException pluginResolutionCause(PluginManagerException e) {
    for (Throwable c = e; c != null; c = c.getCause()) {
        if (c instanceof PluginResolutionException pre) return pre;
    }
    return null;
}

Try / catch

try {
    setupPlugin(project, plugin, session);
} catch (PluginManagerException e) {
    PluginResolutionException pre = pluginResolutionCause(e);
    if (pre != null) {
        // message lines are one failure per artifact: fix the first, the rest usually follow
        log.error('unresolvable plugin {}:{}: {}', plugin.getGroupId(), plugin.getArtifactId(), pre.getMessage());
    }
    throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21). Data as JSON: /api/errors/2f7364d4d54727af. Report an issue: GitHub.