[ 
https://issues.apache.org/jira/browse/MNG-7950?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17794393#comment-17794393
 ] 

ASF GitHub Bot commented on MNG-7950:
-------------------------------------

slawekjaranowski commented on code in PR #1337:
URL: https://github.com/apache/maven/pull/1337#discussion_r1419475500


##########
maven-core/src/main/java/org/apache/maven/plugin/internal/MavenPluginMavenPrerequisiteChecker.java:
##########
@@ -48,16 +57,35 @@ public void accept(PluginDescriptor pluginDescriptor) {
                 requiredMavenVersion == null || 
requiredMavenVersion.trim().isEmpty();
 
         if (!isBlankVersion) {
-            boolean isRequirementMet = false;
+            VersionScheme versionScheme = versionSchemeProvider.get(); // this 
must happen within session
+            VersionConstraint constraint;
             try {
-                isRequirementMet = 
runtimeInformation.isMavenVersion(requiredMavenVersion);
-            } catch (IllegalArgumentException e) {
+                constraint = 
versionScheme.parseVersionConstraint(requiredMavenVersion);
+            } catch (InvalidVersionSpecificationException e) {
                 logger.warn(
                         "Could not verify plugin's Maven prerequisite as an 
invalid version is given in "
                                 + requiredMavenVersion,
                         e);
                 return;
             }
+
+            Version current;
+            try {
+                String mavenVersion = runtimeInformation.getMavenVersion();
+                if (mavenVersion == null || mavenVersion.isEmpty()) {
+                    throw new IllegalArgumentException("Could not determine 
current Maven version");
+                }
+                current = versionScheme.parseVersion(mavenVersion);

Review Comment:
   What do you think, to make a `runtimeInformation.getMavenVersion` returning 
`Version` type instead of String?
   or better new method in runtimeInformation





> Support new version scheme selector in Maven
> --------------------------------------------
>
>                 Key: MNG-7950
>                 URL: https://issues.apache.org/jira/browse/MNG-7950
>             Project: Maven
>          Issue Type: Task
>          Components: Artifacts and Repositories
>            Reporter: Tamas Cservenak
>            Assignee: Tamas Cservenak
>            Priority: Major
>             Fix For: 4.0.0-alpha-9, 4.0.0
>
>
> The generic version scheme is made into component, but it is not enough: 
> there should be an indirection and extension point to support multiple 
> schemes.
> Resolver introduces MRESOLVER-446 for that.
> There is one component in Maven maven-resolver-provider module that needs to 
> be adapted, and use selector instead of ctor passed in scheme.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to