Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jakartaee-platform-dev] version numbers and release qualifiers

On Tue, 21 Jan 2020 at 18:42, Werner Keil <werner.keil@xxxxxxx> wrote:
>
> Aside from the thread here this post by Oracle (Maybe Bill was involved ?;-) also outlines the versioning rather well: https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN400

It's very, very inaccurate (or outdated).

For example, on that page they say:

> All versions with a qualifier are older than the same version without a qualifier (release version).
> For example:
> 1.2-beta-2 is older than 1.2.

which, as specified in already linked
https://maven.apache.org/pom.html#Version_Order_Specification [VOS]
(this _is_ source of truth in that case), and in code linked by BJ
Hargrave just above (implementation/effective source of truth), is
only true for "alpha" < "beta" < "milestone" < "rc" = "cr" <
"snapshot". With "" (empty), "final" and "ga" making version the same
age, and all other qualifiers making version younger/newer than 1.2
(with the exception for "sp" that comes just after "").

Or next para from MAVEN400:

> For example, Maven arranges the version list in the following manner:
> 1.0.1.0
> 1.0.10.1
> 1.0.10.2
> 1.0.9.3
> Version 1.0.9.3 should come before 1.0.10.1 and 1.0.10.2, but the unexpected fourth field (.3) forced Maven to evaluate the version as a string.

Maybe it was true in time of writing that article, but it is not true now:
$ java -jar maven-artifact-3.6.3.jar 1.0.9.3 1.0.10.1
Display parameters as parsed by Maven (in canonical form) and comparison result:
1. 1.0.9.3 == 1.0.9.3
   1.0.9.3 < 1.0.10.1
2. 1.0.10.1 == 1.0.10.1

because [VOS]:
"The Maven coordinate is split in tokens between dots ('.'), hyphens
('-') and transitions between digits and characters"
and
"This gives a sequence of version numbers (numeric tokens) and version
qualifiers (non-numeric tokens)"

> Brings me back to the only unanswered question about the qualifier itself.
> "basic string comparison" for the qualifier sounds like
> 1.2-beta-02 is NOT newer than 1.2-beta-1.
> I could also run it
> but if someone has a quick answer

It IS newer.

-- 
Piotrek


Back to the top