Skip to content

Instantly share code, notes, and snippets.

@gabrieljones
Last active October 13, 2022 14:48
Show Gist options
  • Save gabrieljones/c4b5fa0845f850fc60b6be784af40c35 to your computer and use it in GitHub Desktop.
Save gabrieljones/c4b5fa0845f850fc60b6be784af40c35 to your computer and use it in GitHub Desktop.
Three Dimensions of a Dependency Version

There are at least three natural dimensions to the modern maven dependency version. Dependency resolution version specifiers should incorporate all three dimensions. As of v7.5.1 Gradle has no mechanism to specify all three dimmensions simultaneously. You can do SemVer Range or latest.release vs latest.integration but not all three at the same time. https://docs.gradle.org/current/userguide/single_versions.html

Proposal: Allow use of all three dimensions simultaneously.

  1. SemVer Range eg

    • 2.15.0
    • [2.15.0, 2.15.50[
    • [2.15,2.16[
    • [2,3[
    • [2,[
  2. any or latest

  3. status eg integration or release

Examples:

  • [2,3[:latest.release
    • latest 2.x.x release only
  • [2,3[:latest.integration
    • latest 2.x.x snapshot or release
    • supposedly this is the existing behavior of prefix version range in Gradle 7.5.1, but the doumentation is unclear
  • [2,3[:any.release
    • any 2.x.x release that is brought in transitively from another dependency
  • [2,3[:any.integration
    • any 2.x.x snapshot or release that is brought in transitively from another dependency
    • this is effectively the existing behavior of Maven-style version ranges in Gradle 7.5.1

See also:

https://ant.apache.org/ivy/history/latest-milestone/settings/version-matchers.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment