gnodet commented on code in PR #11770:
URL: https://github.com/apache/maven/pull/11770#discussion_r3652017323
##########
maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcherFactory.java:
##########
@@ -79,6 +81,31 @@ public boolean matches(String requirement) {
}
}
+ private static final Pattern PATTERN_MAJOR_VERSION =
Pattern.compile("^[0-9]+$");
+ private static final Pattern PATTERN_MAJOR_MINOR_VERSION =
Pattern.compile("^[0-9]\\.[0-9]+$");
Review Comment:
This still uses `[0-9]` (single digit) for the major version. Requirements
like `"21.0"` or `"17.0"` won't match this pattern. Compare with
`PATTERN_MAJOR_VERSION` on the line above which correctly uses `[0-9]+`.
```suggestion
private static final Pattern PATTERN_MAJOR_MINOR_VERSION =
Pattern.compile("^[0-9]+\\.[0-9]+$");
```
--
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]