cstamas commented on code in PR #2254:
URL: https://github.com/apache/maven/pull/2254#discussion_r2041185881


##########
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/cisupport/CIDetectorHelper.java:
##########
@@ -33,15 +33,13 @@ public final class CIDetectorHelper {
     private CIDetectorHelper() {}
 
     public static List<CIInfo> detectCI() {
-        List<CIDetector> detectors = 
ServiceLoader.load(CIDetector.class).stream()
+        List<CIInfo> result = new 
ArrayList<>(ServiceLoader.load(CIDetector.class).stream()
                 .map(ServiceLoader.Provider::get)
-                .toList();
+                .map(CIDetector::detectCI)
+                .filter(Optional::isPresent)
+                .map(Optional::get)
+                .toList());

Review Comment:
   Also, to keep things simple I don't want to fiddle with order, as other 
solution would be to test all, and THEN as last, if no hit, "generic"... but 
that would assume there is no (and never will be) overlap between all CI 
systems, which IMO we never know and cannot know (future wise).



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