-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorting of SNAPSHOT versions works differently to Maven and Gradle #62
Comments
Please also check my latest comment here ajoberstar/reckon#189 (comment) It seems that when it comes to details, Maven and Gradle also differ, so it may make sense to stick to the plain specification in this library - but it would probably be worth mentioning that neither Maven nor Gradle do so. |
you might also like https://github.com/cloudflightio/semantic-versioning |
Hello Klaus! Sorry it took me this long to get back to you. And thank you for sharing your findings on the matter. I believe it has to do with the fact that the Specification implies the pre-release versions are case-sensitive (semver/semver#176) and the libraries/tools that don't claim to adhere to the Specification, don't have to play by the rules :) |
After taking another look at the issue, feels like there's not much to add really. In summary, thanks to the scripts and examples provided by @klu2, it appears that neither of the 2 most popular build tools fully comply with SemVer when it comes to comparing versions. That's something to keep in mind. On the other hand, Java SemVer strives to strictly follow the specification, according to which "identifiers with letters or hyphens are compared lexically in ASCII sort order" (SemVer 2.0.0, p.11), in a case-sensitive manner (semver/semver#176). |
Consider the following Kotlin JUnit test, which sorts a couple of version numbers with 3 different libraries:
The Maven and Gradle classes return:
whereas Java Semver returns:
I didn't find anything about
-SNAPSHOT
handling in the Semver Specification but simply the fact that the official Maven and Gradle libraries are working differently here, seems problematic to me.We discovered this issue during discussing ajoberstar/reckon#189.
Happy about your feedback
The text was updated successfully, but these errors were encountered: