What do two exclamation marks `!!` follow the version mean in gradle dependencies

Viewed 320

The build.gradle file of a project I'm working on contains the following line

implementation platform("com.example:fizz-buzz:0.0.1!!")

What do two exclamation marks, !!, following the version mean?

The search in https://docs.gradle.org/ does not return any useful results, nor does Google when searching for site:docs.gradle.com "!!"

1 Answers

Got the answer from a colleague :)

There is, however, a shorthand notation for strict versions, using the !! notation:

dependencies {
    // short-hand notation with !!
    implementation('com.example:fizz-buzz:0.0.1!!')
    // is equivalent to
    implementation('com.example:fizz-buzz') {
        version {
           strictly '0.0.1'
        }
    }
}

Simple version declaration semantics

strictly

Any version not matched by this version notation will be excluded. This is the strongest version declaration. On a declared dependency, a strictly can downgrade a version. When on a transitive dependency, it will cause dependency resolution to fail if no version acceptable by this clause can be selected. See overriding dependency version for details. This term supports dynamic versions.

When defined, overrides previous require declaration and clears previous reject.

Declaring Rich Versions

Related