apache/maven · error

Plugin {}:{} not found in any plugin repository

Error message

Plugin {}:{} not found in any plugin repository

What it means

Variant of the plugin version resolution failure where the repository metadata contained NO versions at all (resolvedPluginVersions == false): Maven could not find the plugin coordinates in any configured plugin repository. The same warn call selects this shorter message and the subsequent PluginVersionResolutionException carries 'Plugin not found in any plugin repository', failing the build. This is the unversioned-plugin equivalent of a 404 artifact.

Source

Thrown at impl/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java:257

                version = selectCompatible(request, preReleases, "PRE-RELEASE");
            }
            if (version == null) {
                version = selectCompatible(request, snapshots, "SNAPSHOT");
            }
            if (version != null) {
                repo = versions.versions.get(version);
            }
        }

        if (version != null) {
            // if LATEST worked out of the box, remain silent as today, otherwise inform user about search result
            if (searchPerformed) {
                logger.info("Selected plugin {}:{}:{}", request.getGroupId(), request.getArtifactId(), version);
            }
            result.setVersion(version);
            result.setRepository(repo);
        } else {
            logger.warn(
                    resolvedPluginVersions
                            ? "Could not find compatible version of plugin {}:{} in any plugin repository"
                            : "Plugin {}:{} not found in any plugin repository",
                    request.getGroupId(),
                    request.getArtifactId());
            throw new PluginVersionResolutionException(
                    request.getGroupId(),
                    request.getArtifactId(),
                    request.getRepositorySession().getLocalRepository(),
                    request.getRepositories(),
                    resolvedPluginVersions
                            ? "Could not find compatible plugin version in any plugin repository"
                            : "Plugin not found in any plugin repository");
        }
    }

    /**
     * Returns the newest version of {@code candidates} that passes {@link #isCompatible}, or {@code null}.

View on GitHub (pinned to e4093d4e12)

Solutions

  1. Check the groupId:artifactId spelling first - this variant almost always means the coordinates do not exist in any configured repository
  2. For a non-standard group, use full coordinates groupId:artifactId:version:goal, or add the group under <pluginGroups> in settings.xml
  3. Confirm the plugin is actually deployed: browse maven-metadata.xml under the group/artifact path in your repository manager; redeploy if missing
  4. If offline or behind a proxy, fix connectivity (or pre-seed the local repo) and retry with -U to refresh metadata

Example fix

# before: group not in pluginGroups, artifact unversioned -> not found
mvn internal:mygoal
# after: full coordinates with version resolve directly
mvn com.mycompany.maven.plugins:my-plugin:1.2.0:mygoal
Defensive patterns

Strategy: try-catch

Validate before calling

# preflight: check the coordinates exist in every repo you rely on
for base in $REPOS; do
  curl -fsSL "$base/com/example/plugins/my-plugin/maven-metadata.xml" >/dev/null \
    && echo "found in $base" || echo "MISSING in $base"
done

Try / catch

// embedding Maven: distinguish not-found from no-compatible-version by message
try {
    pluginVersionResolver.resolve(request);
} catch (PluginVersionResolutionException e) {
    if (e.getMessage().contains("not found")) {
        // coordinates typo or repository gap: fail fast with the GA in the error
        throw new IllegalStateException("Unknown plugin " + request.getGroupId() + ":" + request.getArtifactId(), e);
    }
    throw e;
}

Prevention

When it happens

Trigger: mvn <groupId>:<artifactId>:<goal> or an unversioned <plugin> declaration where the group/artifact does not exist in any of: the POM's pluginManagement, the repositories of the current build, or the <pluginGroups> listed in settings.xml - typically a typo'd groupId or artifactId, a plugin never deployed, or repositories not reachable (offline, proxy).

Common situations: Typos like maven-compiller-plugin; internal plugins not yet deployed to the reachable repository; groupId omitted so Maven only searches default plugin groups; air-gapped builds where remote metadata was never cached.

Related errors


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