0

I have a bit of a thorny maven dependency problem. A plugin in a parent pom.xml requires guava v10 and a dependency in the module I'm trying to build requires guava v18. Not exactly sure how to proceed as both are needed but maven resolves in favor of v10, which crashes the dependency at runtime. I tried skipping the plugin as outlined here (although I'm not sure if it's a good idea), but that didn't help. How do I dig my way out of this?

Johnny
  • 7,073
  • 9
  • 46
  • 72
  • Which side did you ignore - from the parent or the child? It would seem to me like the dependency on Guava 18 would come from the child, and the parent should be able to safely ignore it. – Makoto May 23 '17 at 19:36
  • @Makoto From the child. The guava v18 dependency did indeed come from the child. But somehow it got overridden to v10 because of the plugin in the parent. – Johnny May 23 '17 at 19:37
  • Can you construct two example POMs that illustrate this? I'm having a tough time imagining a scenario in which a dependency in the child can't be excluded by the parent. – Makoto May 23 '17 at 19:39
  • Dependencies of the project and dependencies of plugins are separated so a real example would be really helpful... – khmarbaise May 23 '17 at 19:54
  • I made a project with the two example poms but it compiles and runs perfectly so now I'm not sure what I'm doing wrong. Maybe the v10 depdendency comes from another source entirely. – Johnny May 23 '17 at 20:34
  • `mvn dependency:tree` is your friend for figuring out where dependencies are coming from. – Steve C May 24 '17 at 00:13

1 Answers1

0

Please reference to this post and try to use exclusion to exclude the guava version you don't want to use

TuyenNTA
  • 1,194
  • 1
  • 11
  • 19