Maven dependency conflict resolution is annoying
With Spark development, I am frequently running into dependency conflicts because of Maven’s “nearest wins” strategy for resolving transitive dependencies.
The scenario I have frequently is something like this
- one of the Spark libraries depends on
- Some other dependency in my POM depends on an older version of
- Maven resolves the conflict by giving preference to the “nearest”, or more direct, dependency – so the
older version of
jackson-corewins because it’s one level closer to the root of the dependency graph
jackson-databindnow breaks against the old version of
For any one given library, this can be solved easily in the POM by either excluding offending transitive dependencies, or by explicitly specifying version numbers.
But this is a huge hassle at scale, and it’s super-frustrating that Maven does not implement an option for a “newest wins” strategy instead. By not having such a feature, every single Maven project out there is effectively implementing a one-off “newest wins” on any library that encounters a conflict.