What is the best way to use SemVer versions with maven-artifact?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

What is the best way to use SemVer versions with maven-artifact?

Dennis Lundberg-3
Hi all,

When using a CI environments that create a new SemVer-compliant version for
every build. These could use a qualifier like "-build" together with the
build number. Here is an example:

1.2.3-build417

This signifies build number 417 of the not-yet-released version 1.2.3.

The current behavior of maven-artifact is 1.2.3-build417 > 1.2.3.

This is the opposite of what is expected for a SemVer version number. One
way to solve this would be to add an alias for the qualifier "build" which
should equal "snapshot". So when doing version comparisons 1.2.3-build417 <
1.2.3.

I have a feeling though that this might wreck things for people that do not
follow SemVer. What would be the best way to solve this? It would be great
if a user can tell Maven to follow SemVer. I imagine creating a
SemVer-compliant brother to ComparableVersion, in combination with making
the version comparison class configurable in some way.

--
Dennis Lundberg