Maven works on the principle of nearest wins strategy while resolving the dependency conflicts, that means
whichever version it finds nearer in the tree, it will take that version and ignore the other versions. Actually Maven
is little bit lazy, so whenever it starts looking for a dependency it starts traversing the tree from the root and
whichever version it found earlier, it will select that and returns from their without going further. If it goes
further their might be a chance that it can find some newer version but as it returns from there and take the older
version with it to resolve the dependencies.
Honestly speaking it is not a fault of maven because it wants to finish
the job as soon as possible. Most importantly maven doesn’t know which version your application is expecting so
Maven will say to you, Hey, it is yours responsibility to let me know which version you want and if you don’t tell
me I will work my own way i.e. nearer the better.
|