[ https://issues.apache.org/jira/browse/MRESOLVER-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17806848#comment-17806848 ]
Tamas Cservenak edited comment on MRESOLVER-336 at 1/15/24 2:23 PM: -------------------------------------------------------------------- These two cases (as this issue is about two issues: original description is about "ga" qualifier, while 1st comment is about "foo" string) are such a corner cases, that we agree that those are more "undefined" (than "undocumented"), and both can be circumvented if you use documented versioning scheme, so basically I am keen to close this issue as "won't fix", as none of the examples fit under "normal" versioning schemes (they are more like stretching those). For start: * please do not start versions with qualifier or strings, make them start with number * stick with documented (and recommended) qualifiers, IF must, ideally avoid them. was (Author: cstamas): These two cases (as this issue is about two issues: original description is about "ga" qualifier, while 1st comment is about "foo" string) are such a corner cases, that we agree that those are more "undefined" (than "undocumented"), and both can be circumvented if you use documented versioning scheme, so basically I am keen to close this issue as "won't fix", as none of the examples fit under "normal" versioning schemes (they are more like stretching those). For start: * please do not start versions with qualifier or strings, make them start with number * stick with documented (and recommended) qualifiers > Unexpected handling of qualifiers in GenericVersionScheme > --------------------------------------------------------- > > Key: MRESOLVER-336 > URL: https://issues.apache.org/jira/browse/MRESOLVER-336 > Project: Maven Resolver > Issue Type: Bug > Components: Resolver > Affects Versions: 1.9.5 > Reporter: David M. Lloyd > Priority: Major > Fix For: 2.0.0 > > > Given the following: > {code} > $ jbang --main=org.eclipse.aether.util.version.GenericVersionScheme > org.apache.maven.resolver:maven-resolver-util:1.9.5 0.0.0.ga.ga.foo foo > Display parameters as parsed by Maven Resolver (in canonical form and as a > list of tokens) and comparison result: > 1. 0.0.0.ga.ga.foo -> 0.0.0.ga.ga.foo; tokens: [0, 0, 0, foo] > 0.0.0.ga.ga.foo == foo > 2. foo -> foo; tokens: [foo] > {code} > This is expected iff zero-prefixed qualifiers are considered equal to the > bare qualifier, which does seem to be the case *mostly*. However, we also > have this: > {code} > $ jbang --main=org.eclipse.aether.util.version.GenericVersionScheme > org.apache.maven.resolver:maven-resolver-util:1.9.5 ga.ga.foo foo > Display parameters as parsed by Maven Resolver (in canonical form and as a > list of tokens) and comparison result: > 1. ga.ga.foo -> ga.ga.foo; tokens: [0, 0, foo] > ga.ga.foo < foo > 2. foo -> foo; tokens: [foo] > {code} > In this case we have "zero"-valued qualifiers but no leading numerical > segment, which unexpectedly changes the parsing rules. I would expect > {{ga.ga.foo == foo}} as above. Is this a bug? Is there an explanation for > this behavior? The spec doesn't seem to directly address this. -- This message was sent by Atlassian Jira (v8.20.10#820010)