Can I configure Maven to automatically use the “latest” version of the dependency instead of the “closest” version when resolving version conflicts?
No , you cannot set up a Maven dependency mediation strategy for everything except the closest.
Adding custom dependency mediation strategies were proposed before , but were eventually abandoned, as the proposal included a change in POM XSD, which was not in years.
Why does Maven use the closest default strategy?
The closest strategy is endorsed by Maven for two reasons:
- Simple redefinition of individual conflicts : for any specific conflict you can specify your version in your own POM, and this version will be the closest.
- Playable builds . This would indeed be the result of version ranges anywhere in your dependency graph, but the “latest” mediation strategy will undoubtedly increase the effect of any version range on assembly reproducibility.
But I really need a different addiction mediation strategy. What can I do?
These are your best options:
heenenee
source share