Maven shade plugin is very powerful for resolving dependency conclict, but a situation I have is as follows :
myproject
- guava 31
- thridparty-dependency-1
- guava18
I could relocate the guava 31 dependency and then the conflict will be resolved. And how about following situation :
myproject
- thirdparty-1
- guava31
- thirdparty-2
- guava18
- thirdparty-3
- guava4
Or how about if there are more than two dependencies conflicting as the same dependency but with different versions ?
If I use relocation, then thirdparty-1/guava31 will be relocated but the guava18 and guava4 still conflict.
I'm not sure how to handle this situation.
You need to de-conflict these across the whole project, not just for the shaded uber-jar.
Use Maven
<exclusions>in thepom.xmldeclarationtion to achieve this.For example: