Currently there are (in my eyes) quite strange resolution strategies used in case a version conflict for a dependency is encountered. “Use the newest” and “use the closest” are the ones I saw several times now. However, none of these are actually related to the versions specified.
The most straightforward strategy I can think of is to use the most specific version.
- In case of version ranges, take the intersection of the ranges. In case the intersection is empty, fail. * In case there is a specific version given somewhere in the dependency tree, use it. * Should there be a conflict between multiple specific versions and/or version ranges, fail. * In case there is no specific version specified use the newest of the range intersection.
Is there a way how I can teach gradle this strategy?