I have one huge project A and which has dependency project B (which is not in our control).
The problem is when I include B under A project pom.xml, everything is fine and the build is successful.
But in few of the areas, where we are facing runtime exceptions due to duplicated classes.
Project A has it’s own JDom dependency version and Project B is using different/Same JDom version. During application run time, it’s thowring InvocationTarget exception due to conflicting classes.
How do I ensure, project A uses it’s own jdom while project B uses it’s own or atleast resolving such conflicts?
You can exclude the (transitive) dependency from your project B which is being imported.
The above example will cause your Project B dependency to be pulled in, sans its version of the JDOM library.