Migrate to ApacheHttpClient 5.x

MSAL

Migrate applications to the latest Apache HttpClient 5.x release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions.

org.openrewrite.apache.httpclient5.UpgradeApacheHttpClient_5
mod run . --recipe=org.openrewrite.apache.httpclient5.UpgradeApacheHttpClient_5

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Migrates to ApacheHttpClient 4.5.x
  2. Remove HttpClientBuilder connection settings ignored next to setConnectionManager
  3. Migrate from org.apache.httpcomponents to ApacheHttpClient 5.x dependencies
  4. Migrate Apache HttpAsyncClient 4.x classes to HttpClient 5.x
  5. Migrate to Apache HttpCore Nio Classes to Apache HttpCore 5.x
  6. Remove duplicate Maven dependencies
  7. Migrate RequestConfig to httpclient5
  8. Migrate UsernamePasswordCredentials to httpclient5
  9. Migrate to ApacheHttpClient 5.x deprecated methods from 4.x
  10. Migrate to ApacheHttpClient 5.x Classes Namespace from 4.x
  11. Move StringEntity content encoding into its constructor
  12. Migrate AuthState to AuthExchange
  13. Migrate to ApacheHttpClient 5.x deprecated methods from 4.x
  14. Adds TimeUnit to timeouts and duration methods
  15. Replaces AuthScope.ANY
  16. Migrate deprecated SSLConnectionSocketFactory to DefaultClientTlsStrategy
  17. Change method target to static
  18. Change method target to static
  19. Delete method argument 0 in methods org.apache.hc.client5.http.impl.auth.BasicSchemeFactory <constructor>(java.nio.charset.Charset)
  20. Delete method argument 0 in methods org.apache.hc.client5.http.impl.auth.DigestSchemeFactory <constructor>(java.nio.charset.Charset)