0

I'm creating a library "A" that imports dependency "B". When I include library "A" in a project, I get a ClassNotFoundException if I also don't explicitly include dependency "B" in the project's pom.

When importing dependency "A", is there a way to tell Maven to automatically include all the its dependencies including "B" (without manually declaring to import "B", since it's already in the pom.xml of library "A")?

Mark
  • 67,098
  • 47
  • 117
  • 162
  • B should be installed into the local repo if you build a project that depends on A. Maybe something is wrong with one of the Poms – Blank Chisui Jan 09 '14 at 01:48

1 Answers1

1

Transitive dependency are added by Maven automatically. If you go to a dependency loaded in local repo you will see that near the artifact (typically jar) there is its pom.xml which describes the jar dependencies. If you are using Eclipse open your project pom.xml and go to Dependecy Hierarchy tab there you will see all dependencis including transitive ones.

Evgeniy Dorofeev
  • 133,369
  • 30
  • 199
  • 275