[
https://issues.apache.org/jira/browse/MNG-6064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15380111#comment-15380111
]
Hui Wang commented on MNG-6064:
-------------------------------
Thank you for looking at the ticket.
I'm afraid we have a different understanding on the versioning conventions. I
think the version with "dev" should be older than the version without "dev",
since a "dev" item means the current version is still under development, which
is similar to a version with suffix "alpha","beta", or "rc". for example:
1.0.1 > 1.0.1-dev.2+5612df0
1.0.1 > 1.0.1-beta
So, in the first example you showed, the comparison result should be:
0.1.0-milestone.1 > 0.1.0-milestone.1.dev.2+5612df0
And I looked at the codes of method comparableQualifier() in nested class
StringItem, for an item that isn't included in _QUALIFIERS, it will be
transferred into the size of _QUALIFIERS, concatenated by the item itself. It
makes "dev" version newer than the release version.
And we actually ran into this issue in a complicated development scenario. A
developer had some commits on his branch (including the remote and local one),
but those commits haven't been pushed into master yet. So the
specification-version was built as something like:
1.0.1-dev.1.uncommit+5612df0, and this version was written into the database.
Later, he made a new commit and the version became
1.0.1-dev.2.uncommit+3e7u598, and he wanted to get the version in database
updated. However, ComparableVersion couldn't detect it as a newer version and
the update failed. I know this is not a usual scenario and probably only
happens in development environment, but we still need it in our workflow.
> Add "dev" string item into ComparableVersion
> --------------------------------------------
>
> Key: MNG-6064
> URL: https://issues.apache.org/jira/browse/MNG-6064
> Project: Maven
> Issue Type: Improvement
> Components: Artifacts and Repositories
> Affects Versions: 3.3.9
> Environment: Any operating Systems
> Reporter: Hui Wang
> Priority: Blocker
> Labels: maven
> Original Estimate: 0.5h
> Remaining Estimate: 0.5h
>
> We're using a popular Gradle plugin "gradle-git" ( from Andrew Oberstar ) to
> implement Semantic Versioning with Continuous Deployment. There's a strategy
> supported by gradle-git that defines a "dev" stage when we have something
> uncommitted on a developer branch, which is very useful. Some examples to
> demonstrate the "dev" scenario can be found here:
> https://github.com/ajoberstar/gradle-git/wiki/Release%20Plugins#how-do-i-use-the-opinion-plugin
> However, current version of
> org.apache.maven.artifact.versioning.ComparableVersion does not support "dev"
> stage since there's no item "dev" in the field _QUALIFIERS of nested class
> StringItem. And since this is a private static final field, it is not able to
> be overwritten by inheritance. Can we add the "dev" item into _QUALIFIERS ?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)