20

[ERROR] No plugin found for prefix 'dependency' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\mdhore.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]

<plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>3.0.2</version> <executions> <execution> <id>copy-dependencies</id> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <!-- configure the plugin here --> </configuration> </execution> </executions> </plugin> </plugins> 
5
  • it may be an issue with java10, see github.com/holgerbrandl/kscript/issues/122 Commented May 4, 2018 at 11:10
  • Did you find a solution or workaround for this? Commented Jun 14, 2018 at 15:52
  • 1
    @HolgerBrandl I don't think it's Java 10, it's happening to me with 1.8.0_171 and Maven 3.5.4. Commented Jul 16, 2018 at 20:25
  • 2
    And never mind, it would have happened to me with any version of anything because I fat-fingered it and misspelled "dependency" :/ Commented Jul 16, 2018 at 20:28
  • 4
    oops, I misspelled dependency as well ;) Make sure to check your mvn command again. Commented May 31, 2020 at 9:27

7 Answers 7

24

according to this you have to provide group and artifact id. I run mvn dependencies:tree like the following and it worked.

mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:tree -Dverbose=true 
Sign up to request clarification or add additional context in comments.

1 Comment

Actually, this is a correct answer and should be marked accordingly. It seems that @sonu made a typo in his command line execution like (incorrect plugin artifactId): > mvn org.apache.maven.plugins:dependency-plugin:2.10:tree It is better to execute a shortened command: > mvn dependency:tree
2

I have also encountered the same issue. I typed the wrong command mvn dependences:resolve, the correct one is mvn dependency:resolve.

Comments

2

This should not have happen for usual plugins.
E.g. for maven-compiler-plugin, there is no need to run it as mvn org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile

So most likely, you have made a typo mistake in command line.

enter image description here


But if you have some other plugin not from maven land

then add a line into ~/.m2/settings.xml

e.g. for dependency-check-maven plugin https://jeremylong.github.io/DependencyCheck/dependency-check-maven/

I added <pluginGroup>org.owasp</pluginGroup>

 <pluginGroups> <!-- pluginGroup | Specifies a further group identifier to use for plugin lookup. <pluginGroup>com.your.plugins</pluginGroup> --> <pluginGroup>org.owasp</pluginGroup> </pluginGroups> 

So now just mvn dependency-check:check works.


P.S. I have just tried mvn maven-compiler-plugin:compile and it failed

[ERROR] No plugin found for prefix 'maven-compiler-plugin' in the current project and in the plugin groups [org.owasp, org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/pverest/.m2/repository), nexus (https://nexus.**********/repository/maven-public/)]

mvn compiler:compile works

mvn dependency:help works

Comments

0

I got this error when I forgot to add this parameter. I have to add to each of my Maven comamnds to autheticate with my Maven remote repository. -Djava.net.ssl.trustStore=cacerts.jks. If you don't normally add a parameter like this you probably have another issue.

Comments

0

I got the same error and in my case I didn't have the POM file in the same directory I was in.

Comments

0

An authentication problem (if your repo requires it) can lead to the same problem. Watch out for a Warning (strangely) that says something like

Authentication failed for **** ... 401 Unauthorized 

The plugin metadata could not be retrieved:

Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml 

so I ended up with the error described in the question.

I had to update the authentication credentials NEXUS_USER and NEXUS_PASS (because someone else changed the password without telling).

Comments

-3

make sure there is no import error anywhere in your code then run mvn dependency:tree the error will be gone. I assume you are using mvn and you have some import issue somewhere in your project.

1 Comment

import issue for sure are not related

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.