Skip to content
Latchkey

Maven "Plugin ... could not be found" - Fix Plugin Resolution

Maven could not download a build plugin. The plugin version does not exist where Maven looked, or it lives in a repository Maven was never told about.

What this error means

The build fails before any goal runs with Plugin org.example:my-plugin:1.2.3 or one of its dependencies could not be resolved, naming the plugin coordinates Maven could not fetch.

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

Common causes

Plugin version does not exist on the configured repos

A typo in the plugin version, or a version yanked/never published, means no configured repository can serve it.

Plugin lives in an undeclared pluginRepository

Plugins resolve from <pluginRepositories>, separate from <repositories>. A plugin on a private repo is invisible unless that pluginRepository is declared.

How to fix it

Pin a valid plugin version

Set the plugin to a version that exists on your repositories.

pom.xml
<plugin>
  <groupId>com.example</groupId>
  <artifactId>fancy-maven-plugin</artifactId>
  <version>2.1.0</version>
</plugin>

Declare the hosting pluginRepository

Add the repository that holds the plugin to <pluginRepositories>.

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

How to prevent it

  • Pin every plugin version explicitly and declare internal plugin sources in <pluginRepositories> or settings.xml mirrors.

Frequently asked questions

What causes ""Plugin ... or one of its dependencies could not be resolved""?
A typo in the plugin version, or a version yanked/never published, means no configured repository can serve it.
How do I fix "Plugin ... or one of its dependencies could not be resolved"?
Set the plugin to a version that exists on your repositories.

Related guides

References

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