mbien commented on code in PR #5482:
URL: https://github.com/apache/netbeans/pull/5482#discussion_r1105840499


##########
java/maven/src/org/netbeans/modules/maven/options/MavenSettings.java:
##########
@@ -480,6 +481,18 @@ public void setBinaryDownloadStrategy(DownloadStrategy ds) 
{
             }
         }
 
+        try {
+            try (Stream<Path> jars = Files.list(lib).filter(file -> 
file.getFileName().toString().startsWith("maven-core"))) {  // NOI18N
+                for (Path mavenCoreJar : jars.collect(Collectors.toList())) {
+                    String mavenCoreJarName = 
mavenCoreJar.getFileName().toString();
+                    if 
(mavenCoreJarName.matches("maven-core-\\d+\\.\\d+\\.\\d+\\.jar")) {
+                        return mavenCoreJarName.replace("maven-core-", 
"").replace(".jar", "");
+                    }
+                }
+            }
+        } catch (IOException ignored) {
+        }

Review Comment:
   i like it, thanks Benjamin!



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to