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.
[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.
<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>.
<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.