org.apache.maven.plugin.PluginResolutionException: Plugin or one of its dependencies could not be resolved

August 23, 2017
If you are struggling with the error:
You should check the maven repository server is up firstly. It can be the root of the problem. Of course, sometimes the server is up, and you still get the error. That’s why there are more ways to deal with it in paragraphs below.

Set up the Proxy

This is the second step you should take to find the problem. You should be sure that maven settings.xml contains the proxy settings:

Check the Cache

If Maven still doesn’t work, you should check if it’s not the cache fault. Delete all files in your local repository in:
The path can be different in your system. The path above is the default one. If you have removed the files, you need to rerun the maven command.

IDE Issue

It is time to check if its IDE fault at this point. We will show you the steps for the Eclipse. At command line level outside of Eclipse ran ‘mvn compile’. If the command doesn’t work, go to the next paragraph. If it runs and you’ve still got the same issue, read further. It happens when Eclipse doesn’t use the maven plugin. You should go here:
Window -> Preferences -> Maven -> User Settings and check if you got the path to the settings.xml there. If not, you should create the file yourself in your project. This is a sample of how it should look like:

Automatically download and install missing plugin

You can do that by declaring the missing plugin in the POM file. Maven will automatically retrieve the required plugin. POM file contains all the plugins which your project uses. You should put in the <plugins> section the one you need and wait until Maven download and synchronize himself. In the <plugin> section you should have something similar to:

Manually install needed plugin

If you are reading this paragraph, it means that none of the above ones helped. The last thing you can do is to manually download the plugin from the maven repository website. After doing that just copy it into the folder where Maven holds all the plugins. In the end, just reran the ‘mvn compile’ command.

Click here to add a comment

Leave a comment: