6

My project depends on jparsec, which depends on cglib, which depends on asm. My project also directly depends on asm, but a newer version than the one cglib depends on:

enter image description here

It seems I cannot exclude asm from my jparsec dependency. When I attempt to exclude it with Eclipse, it makes no change to my pom. If I manually exlude it, it has no effect.

Is my only option here to exclude cglib from jparsec and then to manually add a dependency on cglib with asm excluded? This seems a bit convoluted to me, but it does work.

Kent Boogaart
  • 175,602
  • 35
  • 392
  • 393
  • 1
    Yes, that's a valid option to solve this issue. Another option is to place your `asm` dependency above the `jparsec` dependency in pom.xml. – Andrew Logvinov Dec 13 '12 at 15:02
  • @Andrew: thanks. Putting `asm` before `jparsec` allowed the exclusion to work against `asm` rather than only against `cglib`. I'm not sure it's technically needed anymore (it built without the exlusion), but I've added it anyway to be explicit. If you add an answer I'll accept it. – Kent Boogaart Dec 13 '12 at 15:06

2 Answers2

5

I would have expected that if you put asm before jparsec in your POM, no exclusion would be required. The Maven "nearest definition" behaviour would kick in to ensure only 4.1 is used.

Duncan Jones
  • 67,400
  • 29
  • 193
  • 254
3

As per my comment, you have 2 options to solve this issue:

  1. The one that you suggested, e.g. exclude cglib from jparsec and add cglib with asm excluded.
  2. Locate your asm dependency above the jparsec dependency.
Andrew Logvinov
  • 21,181
  • 6
  • 52
  • 54