Skip to content
Latchkey

Maven "Plugin ... or one of its dependencies could not be resolved"

Maven could not download a build plugin (or something the plugin itself depends on). Plugins resolve from plugin repositories, not just <repositories>, so a missing version or an unreachable plugin repo stops the build before any goal runs.

What this error means

The build fails during plugin resolution with Plugin <groupId>:<artifactId>:<version> or one of its dependencies could not be resolved, followed by a Could not find/Could not transfer cause.

mvn output
[ERROR] Plugin org.apache.maven.plugins:maven-shade-plugin:3.5.0 or one of its
dependencies could not be resolved: Could not find artifact
org.apache.maven.plugins:maven-shade-plugin:jar:3.5.0 in central
(https://repo.maven.apache.org/maven2)

Common causes

Plugin version missing or not on a reachable repo

A non-existent plugin version, or a plugin hosted on a private repo not declared under <pluginRepositories>, cannot be fetched.

A transitive plugin dependency is unavailable

The plugin itself resolves but one of its own dependencies does not, often because a needed repository is missing or a transient transfer failed.

How to fix it

Pin a valid version and declare the plugin repo

Use a published plugin version and, for non-Central plugins, declare a <pluginRepository>.

pom.xml
<pluginRepositories>
  <pluginRepository>
    <id>company-plugins</id>
    <url>https://nexus.example.com/repository/maven-public/</url>
  </pluginRepository>
</pluginRepositories>

Force a clean plugin re-resolve

Rule out a cached miss or a transient transfer error.

Terminal
mvn -U -B verify

How to prevent it

  • Pin plugin versions in <build><pluginManagement> so they are explicit and reproducible.
  • Declare <pluginRepositories> for any plugin not on Central.
  • Cache ~/.m2/repository so plugins resolve from cache after the first run.

Frequently asked questions

What causes ""Plugin ... could not be resolved""?
A non-existent plugin version, or a plugin hosted on a private repo not declared under <pluginRepositories>, cannot be fetched.
How do I fix "Plugin ... could not be resolved"?
Use a published plugin version and, for non-Central plugins, declare a <pluginRepository>.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card