protected CloseableHttpClient getHttpClient()

in src/main/java/org/apache/sling/maven/bundlesupport/AbstractBundleRequestMojo.java [226:241]


    protected CloseableHttpClient getHttpClient() {
        // Generate Basic scheme object
        final BasicScheme basicAuth = new BasicScheme();
        basicAuth.initPreemptive(new UsernamePasswordCredentials(user, password.toCharArray()));

        // restrict to the Sling URL only
        final HttpHost target = new HttpHost(
                getTargetURL().getScheme(),
                getTargetURL().getHost(),
                getTargetURL().getPort());

        return HttpClients.custom()
                .setDefaultRequestConfig(getRequestConfigBuilder().build())
                .addRequestInterceptorFirst(new PreemptiveBasicAuthInterceptor(basicAuth, target, getLog()))
                .build();
    }