To add: if you would like to avoid depending on Maven's dependency mediation behaviour, then a useful tool is Maven Enforcer's dependencyConvergence rule.
https://maven.apache.org/enforcer/enforcer-rules/index.html