gnodet commented on code in PR #2116:
URL: https://github.com/apache/maven/pull/2116#discussion_r1958793700


##########
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/BaseParser.java:
##########
@@ -352,6 +352,22 @@ protected Map<String, String> 
populateSystemProperties(LocalContext context) {
         String mavenVersion = 
buildProperties.getProperty(CLIReportingUtils.BUILD_VERSION_PROPERTY);
         systemProperties.setProperty("maven.version", mavenVersion);
 
+        boolean snapshot = mavenVersion.endsWith("SNAPSHOT");
+        if (snapshot) {
+            mavenVersion = mavenVersion.substring(0, mavenVersion.length() - 
"SNAPSHOT".length());
+            if (mavenVersion.endsWith("-")) {
+                mavenVersion = mavenVersion.substring(0, mavenVersion.length() 
- 1);
+            }
+        }
+        String[] versionElements = mavenVersion.split("\\.");
+        if (versionElements.length != 3) {
+            throw new IllegalStateException("Maven version is expected to have 
3 segments: '" + mavenVersion + "'");

Review Comment:
   This is not related to any project's version built by Maven.  We're only 
parsing the version of Maven itself here, so whatever your team decide is 
unrelated to whatever our (Maven) team decides.



-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to