code: public static Proxy asProxy(org.apache.maven.settings.Proxy proxy) {
          final Authentication authentication;
          if (proxy.getUsername() != null || proxy.getPassword() != null) {
              authentication = new AuthenticationBuilder().addUsername(proxy.getUsername())
                      .addPassword(proxy.getPassword()).build();
          } else {
              authentication = null;
          }
          return new Proxy(proxy.getProtocol(), proxy.getHost(), proxy.getPort(), authentication);
      }
docs: Converts Maven Proxy to Aether Proxy
  
  @param proxy
  the Maven proxy to be converted
  @return Aether proxy equivalent