Files
renovate/lib/modules/versioning/maven
Björn Kautler 6d0eb5b9bb fix(maven): do not loose the v-prefix of versions (#38895)
* fix(maven): determing properly closed ranges

A Maven range like [1,2) contains various (usually pre-release) versions of the 2.x line.
By Maven definition the smallest possible 2.x version is 2-alpha, so a properly closed range that only allows 1.x versions
would be [1,2-alpha). This is now detected and properly advanced.

* fix(maven): normalize both sides of version comparison

Without this a leftValue of v3 is incremented to 4 and then compared to v4.

* fix(maven): do not loose the v-prefix of versions in range handling

If versions of a project always start with a v prefix, this was lost when Maven ranges were involved.
The coerce and increment methods stripped the v away and it was never added back in.

* Properly fix underlying problem and make PR standalone

* Add missing coverage

* Remove unused callback parameter
2026-03-19 10:07:48 +00:00
..

Maven versioning is similar to SemVer but also very different in places. It's specified by Maven itself.

Ranges are supported using Maven's special syntax.

For development purposes, download maven-artifact JAR and run:

$ java -jar maven-artifact-*.jar 3.2.4-alpha-1 3.2.4-SNAPSHOT 3.2.4.0
Display parameters as parsed by Maven (in canonical form) and comparison result:
1. 3.2.4-alpha-1 == 3.2.4.alpha.1
   3.2.4-alpha-1 < 3.2.4-SNAPSHOT
2. 3.2.4-SNAPSHOT == 3.2.4.snapshot
   3.2.4-SNAPSHOT < 3.2.4.0
3. 3.2.4.0 == 3.2.4