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


##########
compat/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuilder.java:
##########
@@ -251,4 +254,18 @@ public Object execute(String expression, Object value) {
 
         return result;
     }
+
+    private List<Server> serversByIds(List<Server> servers) {
+        return servers.stream()
+                .flatMap(server -> Stream.concat(
+                        Stream.of(server), server.getAliases().stream().map(id 
-> serverAlias(server, id))))
+                .toList();
+    }
+
+    private Server serverAlias(Server server, String id) {
+        return new 
Server(org.apache.maven.api.settings.Server.newBuilder(server.getDelegate(), 
true)
+                .id(id)
+                .aliases(List.of())
+                .build());
+    }

Review Comment:
   It is the core of change.
   
   Based on additional tag - aliases we create a next server instance in memory 
on server list.
   So all others plugins tools will see destination list of servers original 
declared in settings and created based on aliases tag.



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

Reply via email to