A version that is closer to the root of your dependency tree will be preferred. If both conflicting versions have the same depth in the tree, the first wins (starting at the top of the tree).
Is this an absolutely stupid rule? Yes. Its only advantage is that you can always force a certain version of the dependency to be declared by declaring it as a direct dependency of your project.
So, in your case, B: 2.0 is used, since it is declared as a direct dependency. If A does not work fine with B: 2.0, then, well, either use B: 1.0 in your code, or select another library that does the same as A, but does not cause a conflict.
source share