slachiewicz commented on issue #1954:
URL: 
https://github.com/apache/maven-resolver/issues/1954#issuecomment-5482530033

   ### Summary & Migration Plan
   
   As noted, upgrading from Apache HttpComponents 4.x (`httpclient` / 
`httpcore`) to HttpComponents 5.x 
(`org.apache.httpcomponents.client5:httpclient5` / 
`org.apache.httpcomponents.core5:httpcore5`) is not a drop-in dependency bump 
due to breaking API changes across connection management, SSL/TLS 
configuration, authentication, and execution models.
   
   Below is the proposed implementation plan to complete the transition for 
`maven-resolver-transport-apache`:
   
   ---
   
   #### 1. Scope & Architecture
   * **Target Coordinates:** 
     * `org.apache.httpcomponents.client5:httpclient5`
     * `org.apache.httpcomponents.core5:httpcore5`
   * **Transport Refactoring:**
     * Refactor `ApacheTransporter` and supporting classes to use the 
HttpClient 5 classic (synchronous) execution APIs (`CloseableHttpClient`, 
`ClassicHttpRequest`, `HttpClientContext`).
     * Re-implement connection management using 
`PoolingHttpClientConnectionManager`.
     * Update SSL/TLS configuration and custom trust/key store setup using 
`SSLConnectionSocketFactoryBuilder` / `TlsSocketStrategy`.
     * Adapt authentication mechanisms (Basic, Digest, NTLM, and preemptive 
auth) and proxy routing to HC5 APIs.
     * Map existing Maven Resolver transport configuration keys (timeouts, pool 
size, headers, retry handlers) to HC5 request/socket configs.
   
   #### 2. Implementation Steps
   1. **Dependencies:** Update `maven-resolver-transport-apache/pom.xml` to 
depend on HC5 client & core coordinates; remove legacy 4.x artifacts.
   2. **Core Implementation:** Port connection pool lifecycle, HTTP execution 
pipeline, range requests (resume download), and response header handling to HC5.
   3. **Session & Auth Cache:** Ensure session state / auth cache handling is 
isolated and compatible across classloaders and concurrent downloads.
   4. **Testing & Parity:**
      * Run existing integration test suites against local HTTP/HTTPS test 
servers (covering auth, proxies, TLS verification, resume downloads).
      * Verify performance and connection reuse under high concurrency.
   
   ---
   
   > **Note for Users in the Interim:**
   > For environments seeking to eliminate legacy HttpComponents 4.x 
dependencies immediately, modern alternative transports are available in Maven 
Resolver:
   > * `maven-resolver-transport-jdk` (built-in Java 11+ 
`java.net.http.HttpClient`)
   > * `maven-resolver-transport-jetty`


-- 
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]

Reply via email to