michael-o commented on code in PR #2333:
URL: https://github.com/apache/maven/pull/2333#discussion_r3077862592
##########
api/maven-api-settings/src/main/mdo/settings.mdo:
##########
@@ -529,6 +529,17 @@
Extra configuration for the transport layer.
</description>
</field>
+ <field>
+ <name>aliases</name>
+ <version>1.3.0+</version>
+ <description>
+ List of additional server aliases. For each alias, an additional
server will be generated by copying the entire configuration, but using a
different ID.
+ This is useful when the same credentials should be used for
multiple servers. </description>
Review Comment:
Trailing whitespace
##########
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:
This looks very ugly. It is the clien't responsibility to traverse the
Settings object, no?
--
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]