Managing transitive dependency version conflicts is a common challenge in large projects. Gradle 6 introduces a 'strict version' declaration that provides meaningful semantics when downgrading dependencies. Unlike older approaches (exclude or force) or Maven's resolution strategy, strict versions propagate the version constraint and its rationale to downstream consumers. Using a dependency constraint with strictly() and a because() clause, developers can pin a specific version, reject incompatible ones, and document why the decision was made. Best practices recommend using version ranges in strict declarations for reusable libraries and always documenting the reason with because().
Table of contents
Table of ContentsIntroductionWhat if that version upgrade is a problem? #A meaningful downgrade #Why do the semantics matter? #Best practices for strict versions #Conclusion #DiscussSort: