Major version style comparison

Can anyone tell me definitively how the following 2 major version range specifications are different?
[2,3) vs 2.+. I specifically want to know if there is any difference in how an “alpha” version would be handled. Essentially, I don’t want to include alpha versions.

I’ve recently started using the following because I haven’t been able to address it differently.

ext {
    excludedVersionPattern = "alpha|beta"  // Default value
}

configurations.configureEach {
    resolutionStrategy {
        componentSelection {
            all { ComponentSelection selection ->
                def dversion = selection.candidate.version
                if (dversion ==~ /.*[-_.]?(${excludedVersionPattern}).*/) {
                    reject("Rejecting $dversion as it's an excluded version")
                }
            }
        }
    }
}

This approach is rather brittle and something I would like to avoid if possible.

Can anyone tell me definitively how the following 2 major version range specifications are different?
[2,3) vs 2.+ .

You can read about it at Declaring Versions and Ranges which says for example:

  • An upper bound exclude acts as a prefix exclude. This means that [1.0, 2.0[ will also exclude all versions starting with 2.0 that are smaller than 2.0. For example versions like 2.0-dev1 or 2.0-SNAPSHOT are no longer included in the range.

So no, the specifications are not different, as long as there is no version 2 (without dot), because that would not be matched by 2.+ afaik. But other than that the range should be identical.

Essentially, I don’t want to include alpha versions.

Then you probably have no chance but to use a component selection rule, if alpha and release versions are coming from the same repository. Otherwise alpha versions of 2. versions would be included.