What This Error Means
Maven cannot download a build plugin (or its transitive dependencies) from configured plugin repositories.
How to Fix It
- Confirm the plugin version is correct and exists in the repository you expect.
- If the plugin is hosted outside Central, ensure
<pluginRepositories>(or your mirror) includes that repository. - Configure credentials for the plugin repository in
~/.m2/settings.xmlunder<servers>(matching repository<id>). - Force updates once:
mvn -U -DskipTests package. - Delete cached failures under
~/.m2/repository/<groupId path>/<artifactId>/(including*.lastUpdated), then retry. - If resolution still fails, run with debug logs to see which repositories Maven is attempting:
mvn -X -DskipTests package.
Why It Happens
- The plugin version does not exist in any configured plugin repository.
- A mirror/proxy repository is misconfigured and does not proxy the plugin's upstream repository.
- The plugin repository requires authentication (401/403) and Maven is not sending valid credentials.
- A cached failed download (
*.lastUpdated) prevents Maven from retrying immediately.
How to Verify
- Re-run your Maven build and confirm the plugin downloads and executes successfully.
- Confirm the plugin artifacts exist under
~/.m2/repository/.
Manual plugin repository checks
- Identify the exact plugin coordinates Maven is trying to resolve (copy from the error output).
- Force a remote re-check once:
mvn -U -DskipTests package. - Print effective settings to check mirrors/proxies/servers:
mvn -q help:effective-settings. - If the plugin is internal, confirm your repository configuration includes the plugin repository (or a mirror that proxies it).
Common CLI Output
[ERROR] Plugin org.apache.maven.plugins:maven-surefire-plugin:3.2.5 or one of its dependencies could not be resolved: Could not find artifact org.apache.maven.plugins:maven-surefire-plugin:jar:3.2.5 in central (https://repo.maven.apache.org/maven2)[ERROR] Plugin com.example:internal-plugin:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for com.example:internal-plugin:jar:1.0.0 How Maven resolves plugins
- Maven resolves build plugins separately from regular project dependencies.
- Plugins are downloaded from plugin repositories (which may be mirrored) and cached in the same local repository (
~/.m2/repository). - If plugin repositories are misconfigured, blocked, or missing required credentials, plugin resolution fails.
Prevention Tips
- Pin plugin versions in
pom.xmland keep them consistent across modules. - Use a repository manager mirror that proxies plugin repositories and caches them for CI stability.
- Avoid duplicating plugin repository configuration across many projects, centralize it in
settings.xmlor a parent POM.
Where This Can Be Triggered
github.com/apache/maven/blob/maven-3.9.11/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java
When resolving plugin descriptors, Maven logs a warning and rethrows PluginResolutionException (often containing "Plugin ... or one of its dependencies could not be resolved"). - GitHub
} catch (PluginResolutionException e) {
logger.warn("Failed to retrieve plugin descriptor for {}: {}", plugin, e.getMessage());
throw e;
}