Question

I'm playing with the idea of creating uber jars for my services but I'm worried about including jars that have conflicting dependencies. What happens when jar A depends on slf4j-1.0 and jar B depends on slf4j-2.0 and there were major changes between 1.0 and 2.0? When those jars both get included in the uber jar do I have to write specific filters by namespace or does something happen during the shadow process that namespaces the jars?

thanks for the help

Was it helpful?

Solution

You are correct to worry. You end up with collisions (a colleague called it 'dll hell all over again') and sometimes you can have classes from both v1 and v2 in the same directory in the jarfile.

You can exclude one or the other version easily, but if your dependencies need them both, you are faced with the following options:

Whatever you do, gradle dependencies is helpful.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top