static void activateHttpAndHttpsProxies(Settings settings, SettingsDecrypter decrypter)
      throws MojoExecutionException {
    List<Proxy> proxies = new ArrayList<>(2);
    for (String protocol : ImmutableList.of("http", "https")) {
      if (areProxyPropertiesSet(protocol)) {
        continue;
      }
      settings.getProxies().stream()
          .filter(Proxy::isActive)
          .filter(proxy -> protocol.equals(proxy.getProtocol()))
          .findFirst()
          .ifPresent(proxies::add);
    }

    if (proxies.isEmpty()) {
      return;
    }

    SettingsDecryptionRequest request = new DefaultSettingsDecryptionRequest().setProxies(proxies);
    SettingsDecryptionResult result = decrypter.decrypt(request);

    for (SettingsProblem problem : result.getProblems()) {
      if (problem.getSeverity() == SettingsProblem.Severity.ERROR
          || problem.getSeverity() == SettingsProblem.Severity.FATAL) {
        throw new MojoExecutionException(
            "Unable to decrypt proxy info from settings.xml: " + problem);
      }
    }

    result.getProxies().forEach(MavenSettingsProxyProvider::setProxyProperties);
  }
Initializes proxy settings based on Maven settings if they are not already set by the user
directly.

@param settings Maven settings
jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenSettingsProxyProvider.java