0

i have a jar file in my lib folder which is not in the pom file, so i was wondering which dependency downloaded this jar so i can exclude this jar from the dependency. please advise if there's a maven command to know which of my dependencies are downloading this jar.

Case:

i found in my classpath the jar slf4j-api-1.5.8.jar, and i want to know which dependency is downloading this jar so i can exclude this jar from the dependency.

fresh_dev
  • 6,694
  • 23
  • 67
  • 95
  • Can't you see what the jar contains and google it to know which lbiraries uses this jar? – Adel Boutros Jan 03 '12 at 14:03
  • possible duplicate of [In Maven 2, how do I know from which dependency comes a transitive dependency?](http://stackoverflow.com/questions/34144/in-maven-2-how-do-i-know-from-which-dependency-comes-a-transitive-dependency) – dogbane Jan 03 '12 at 14:07
  • If your dependencies are in `lib/` folder, that is certainly not maven who has put them there. Ask your team member who have committed this jar to source repository. – dma_k Jan 03 '12 at 16:49

2 Answers2

3

Look for Maven Dependency Plugin

 mvn dependency:tree -Dincludes=velocity:velocity

you can just run

 mvn dependency:tree

to see complete dependency tree. But good if you read the doc.

Nishant
  • 54,584
  • 13
  • 112
  • 127
1

Jar file does not necessarily contain its dependencies. It can contain the list of first level dependencies in ClassPath property of manifest.mf that can be found under META-INF. So to find dependencies you should refer to manual (if the developer wrote it) or try to resolve them using tool like JDepend.

AlexR
  • 114,158
  • 16
  • 130
  • 208