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.
[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>.
<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.
mvn -U -B verifyHow 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/repositoryso plugins resolve from cache after the first run.