In my maven project, I am using a dependency A which in turn uses another dependency B (Version 1.0). Now, in my project, I also need to use the dependency B directly but a different version (need to use 2.0) than what dependency A is using internally. So to do that I added a maven dependency B version 2.0 in my pom.xml. But this is causing an issue when I am using functionality of dependency A because it is not compatible with dependency B (Version 2.0 - which I have included explicitly in my pom).
How can I include a new version of dependency B in my pom without having the dependency A refer to the new version rather making it refer to 1.0 of dependency A?
Project -> A -> B (v1.0)
Project -> B (v2.0) # this is causing A to refer B's 2.0 instead of 1.0
So what I want is to include the v2.0 of dependency B but still make dependency A to refer v.10 B.