maven-mvnd icon indicating copy to clipboard operation
maven-mvnd copied to clipboard

Consistent Version Numbering Scheme

Open adamretter opened this issue 2 years ago • 3 comments

Just a suggestion that it might be nice to stick to a consistent version numbering scheme. May I suggest Semantic Versioning 2.0.0

So far there have been releases with version numbers like:

  1. {major}.{minor}.{hotfix} e.g. version 0.0.1 through 0.9.0. This is nice, and is inline with Semver.
  2. {major}.{minor}.{hotfix}-{pre-release}. e.g. versions 1.0.0-m1 and 1.0.0-m4. This is nice, and is also inline with Semver.
  3. {major}.{minor}-{pre-release}. e.g. version 1.0-m6. This is not so nice, as it is not clear if this is a continuation of the previous 1.0.0 pre-releases or not. This is NOT inline with Semver. Additionally the filenames for the downloads of 1.0-m6 seem to encode a second pre-release version label, e.g. 1.0-m6-m39 and 1.0-m6-m40. There is nothing necessarily wrong with the m39 aspect, and that can also be accommodated by Semver if you wished, e.g. use instead 1.0.0-m6-m39.

The 3rd scheme documented above adds additional difficulties for scripts that are trying to work out the latest version and/or download a specific version. Whereas for all previous versions such a script could set a VERSION=0.9.0 and access a URL like:

https://archive.apache.org/dist/maven/mvnd/$VERSION/maven-mvnd-${VERSION}-linux-amd64.zip

That is not possible with 1.0-m6 as you would instead need something like:

https://archive.apache.org/dist/maven/mvnd/${VERSION}/maven-mvnd-${VERSION}-${SECONDVERSION}-linux-amd64.zip

and of course such a URL would not in a script be backwards compatible.

It would be great if you could settle on a consistent version numbering scheme :-)

adamretter avatar May 12 '23 08:05 adamretter

Thanks for the feedback, @adamretter!

What you call second pre-release version, is in fact the maven stream (3.9.x vs. 4.0.x) contained in the given mvnd distro. @gnodet prefers doing a single mvnd release for both flavors. While I guess we could discuss about the format of the second pre-release part (e.g. to make it more informative by including micro of the embedded Maven), its presence would probably be hard to eliminate.

I'd be all for having the hotfix part back - i.e. 1.0.0-m6-m39 rather than 1.0-m6-m39.

WDYT, @gnodet?

ppalaga avatar May 12 '23 10:05 ppalaga

I wonder if the Maven Stream part of the version could be considered "build metadata"? If so then there is a nice provision in Semver 2.0.0 already for this. Your version numbers would then look like:

  1. 1.0.0-m6+m39
  2. 1.0.0-m6+m40

As the use of the m mnemonic prefix for both parts (I am guessing m for milestone in the first part, and m for Maven in the second part?) confused me, then perhaps this would be better even:

  1. 1.0.0-m6+mvn-3.9
  2. 1.0.0-m6+mvn-4.0

As I understand it, Semver 2.0.0 is compatible also with how Maven itself resolves dependency versions... which is nice ;-)

adamretter avatar May 12 '23 10:05 adamretter

I removed the micro version because sdkman is limited to 15 characters for the version. I was thinking about using 1.0-m6-m39-mvnd as a maven version for mvnd in sdkman. It would be nice to have a little more room in the version though... I'm not sure how sdkman / home-brew handle the + char...

gnodet avatar May 15 '23 08:05 gnodet