It' a pretty strange problem.
I have a 3rd party jar dependency published in inhouse artifactory. let's name it irresistibility.jar
irresistibility.jar jar is fat: it contains some useful classes + com.mycompany.anotherstuff.*
com.mycompany.anotherstuff.*
is included into irresistibility.jar fat jar during build and it conflicts with anotherstuff.jar
which is also dependency and has up to date com.mycompany.anotherstuff.*
irresistibility.jar and anotherstuff.jar clash in runtime and sometimes outdated classes com.mycompany.anotherstuff.*
from irresistibility.jar take over and all goes really bad.
I have NO chance to change irresistibility.jar build. It's just exist. I have no chance to rebuild from sources, it will take the rest of my life (legacy, you know).
Is there any viable option to:
exclude classes
com.mycompany.anotherstuff.*
from irresistibility.jar using gradle when I add irresistibility.jar as dependencydo some sort of hack and unzip irresistibility.jar, delete
com.mycompany.anotherstuff.*
and republish irresistibility.jar as irresistibility-good-stuff.jar without conflicting classes?