ascheman commented on PR #12771:
URL: https://github.com/apache/maven/pull/12771#issuecomment-5346682681

   @cstamas — adopted, thank you, that is exactly the right hook.
   
   > 
https://github.com/apache/maven-resolver/blob/master/maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericQualifiers.java#L32
   > You are looking for positive qualifiers
   
   `GenericQualifiers` is public since maven-resolver 2.0.21, which this line 
already depends on, so no
   version bump is needed. The whole hand-rolled base-version scan is gone:
   
   ```java
   boolean isPreRelease(String version) {
       return 
GenericQualifiers.qualifier(version).orElse(GenericQualifiers.QUALIFIER_ZERO) < 
0;
   }
   ```
   
   Checked against 2.0.21 before switching, and it is strictly better than what 
I had — it also handles
   the short forms and does not match `rc` inside a word:
   
   | version | qualifier |
   |---|---|
   | `1.0`, `3.15.0`, `33.7.0-jre`, `1.0-arc` | (none) |
   | `1.0-ga`, `1.0-final` | 0 |
   | `1.0-sp1` | +1 |
   | `4.0.0-beta-1`, `1.0.beta.1`, `1.0-b2` | -4 |
   | `1.0-M1`, `1.0-rc1`, `1.0-cr1` | -3 / -2 |
   | `1.0-SNAPSHOT` | -1 |
   
   Every existing test expectation held unchanged; I added `1.0-b2` and 
`1.0-arc` for the two cases the
   reused implementation gets right by construction. 
https://github.com/apache/maven/pull/12771/commits/2d2ab470d7e351260e6732b72f6787d0521f1f99
   
   I did not take `GenericQualifiersVersionFilter` from that commit — it 
filters a version *collection*
   during collection, whereas this code path picks one version out of 
repository metadata for an
   unversioned plugin. Happy to look again if you think it fits better there.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to