vdurmont / semver4j

Semantic versioning for Java apps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with prerelease tags/npm

tdraier opened this issue · comments

According to https://github.com/npm/node-semver#prerelease-tags , "If a version has a prerelease tag (for example, 1.2.3-alpha.3) then it will only be allowed to satisfy comparator sets if at least one comparator with the same [major, minor, patch] tuple also has a prerelease tag."

For example,

new Semver("3.0.0-rc1", Semver.SemverType.NPM).satisfies(Requirement.buildNPM("^2.2.0"))

incorrectly returns true ( "^2.2.0" desugar to ">2.2.0 <3.0.0" , and 3.0.0-rc1 < 3.0.0). This should return false, as even if 3.0.0-rc1 is in the range, no comparator with the same [major, minor, patch] tuple as a prelease tag.

I just released v2.0.2 with this fix. I pushed it to maven central, it should be available in a few hours.
Thanks for the help!

https://github.com/vdurmont/semver4j/releases/tag/v2.0.2