[ https://issues.apache.org/jira/browse/MRESOLVER-382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17740128#comment-17740128 ]
ASF GitHub Bot commented on MRESOLVER-382: ------------------------------------------ michael-o commented on code in PR #315: URL: https://github.com/apache/maven-resolver/pull/315#discussion_r1252831609 ########## maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporter.java: ########## @@ -295,6 +300,20 @@ final class HttpTransporter extends AbstractTransporter { this.client = builder.build(); } + private InetAddress getBindAddress(RepositorySystemSession session) { + String bindAddress = ConfigUtils.getString(session, null, BIND_ADDRESS); + return Optional.ofNullable(bindAddress).map(this::resolveAddress).orElse(null); + } + + private InetAddress resolveAddress(String bindAddress) { + try { + return InetAddress.getByName(bindAddress); + } catch (UnknownHostException uhe) { + throw new IllegalArgumentException( + "Given bind address (" + bindAddress + ") cannot be resolved. Reverting to default route.", uhe); Review Comment: The message is not correct anymore > Define local outgoing (bind) address > ------------------------------------ > > Key: MRESOLVER-382 > URL: https://issues.apache.org/jira/browse/MRESOLVER-382 > Project: Maven Resolver > Issue Type: Improvement > Components: Resolver > Reporter: Benjamin Marwell > Assignee: Benjamin Marwell > Priority: Major > > Currently, outgoing PUT connections (or download from central for that > matter) will be resolved over the default route. > However, this is not always feasible. > h2. Expected behaviour > A new property {{aether.connector.http.bind.address}} is defined for outgoing > requests, so that other routes (other interfaces) can be used. > h2. Actual behaviour > Certain systems cannot be reached when a firewall is only opened on a > non-default interface. > h2. User Story > Builds on servers with multiple interfaces: > * The default route is defined poorly > * Other interfaces are available and have the requested firewall rules > * User defines -Daether.connector.http.bind.address=${myotherip} (or local > address) to make outgoing connections to bind to another interface than the > default one. -- This message was sent by Atlassian Jira (v8.20.10#820010)