Reputation: 1040
It is mentioned here that
If you do not follow Maven versioning standards in your project versioning scheme, then for version comparison, Maven interprets the entire version as a simple string
From the example, we can see that 1.0.9.3
should be treated the more updated than 1.0.10.1
1.0.1.0
1.0.10.1
1.0.10.2
1.0.9.3 < most updated version
There is a project I am currently working on. It has a dependency on a package com.example.http
, which is versioned 1.0.12.2
. There are several updates on it now. A subset of the versions are (1.0.0
, 1.0.9
, 1.0.12.2
, 1.0.16
). Since it does not follow Maven versioning standards, I would expect the order of these versions to be:
1.0.0
1.0.12.2
1.0.16
1.0.9
Q1:
However, when I run mvn versions:display-dependency-updates
, it said that 1.0.16
was the most updated version. Why?
Q2:
Should I do something to removed the non-standard 1.0.12.2
? notes: all, but 1.0.12.x
, follows the maven versioning standard
[INFO] com.example:http ............................ 1.0.12.2 -> 1.0.16
Upvotes: 0
Views: 91
Reputation: 35795
The mechanism changed about 10 years ago, so your information is outdated. Maven is able to sort arbitrarily long version numbers, see e.g. https://blog.soebes.de/blog/2017/02/04/apache-maven-how-version-comparison-works/
More information can also be found in the answer https://stackoverflow.com/a/31482463/927493
Upvotes: 2