TL;DR version
Can Maven's shade plugin affect third party libraries?
Longer version
My co-worker and I have been arguing about using Maven's shade plugin to fix dependency errors on third party libraries. We have the following dependency hierarchy:
foo (our project)
+--- bar:1.0.0
| \--- baz:1.1.1
\--- boo:1.0.0
\--- baz:2.2.2
(foo
depends on bar
and boo
; both depend on different versions of baz
)
The problem is, bar
and boo
cannot use a different version of baz
.
In our project we do not rely directly on baz
, but we do rely on bar
and boo
.
My co-worker says we can use Maven's shade plugin to shade baz:1.1.1
or baz:2.2.2
to make it work, but it doesn't sound logical because for it to work it would have to modify the signatures in the class files of bar
or boo
. Surprisingly though, he did manage to get through the NoSuchMethodError
he's been dealing with using shade, and to be honest I'm not quite sure how..
So, does shade actually affect third party libraries and not just my own code?
Also, if it doesn't, is there a way to solve the above conflict?