Migrate to ApacheHttpClient 5.x
MSALMigrate 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_5mod run . --recipe= org. openrewrite. apache. httpclient5. UpgradeApacheHttpClient_5Install 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.
- Migrates to ApacheHttpClient 4.5.x
- Remove
HttpClientBuilderconnection settings ignored next tosetConnectionManager - Migrate from org.apache.httpcomponents to ApacheHttpClient 5.x dependencies
- Migrate Apache HttpAsyncClient 4.x classes to HttpClient 5.x
- Migrate to Apache HttpCore Nio Classes to Apache HttpCore 5.x
- Remove duplicate Maven dependencies
- Migrate
RequestConfigto httpclient5 - Migrate
UsernamePasswordCredentialsto httpclient5 - Migrate to ApacheHttpClient 5.x deprecated methods from 4.x
- Migrate to ApacheHttpClient 5.x Classes Namespace from 4.x
- Move
StringEntitycontent encoding into its constructor - Migrate
AuthStatetoAuthExchange - Migrate to ApacheHttpClient 5.x deprecated methods from 4.x
- Adds
TimeUnitto timeouts and duration methods - Replaces
AuthScope.ANY - Migrate deprecated
SSLConnectionSocketFactorytoDefaultClientTlsStrategy - Change method target to static
- Change method target to static
- Delete method argument 0 in methods
org.apache.hc.client5.http.impl.auth.BasicSchemeFactory <constructor>(java.nio.charset.Charset) - Delete method argument 0 in methods
org.apache.hc.client5.http.impl.auth.DigestSchemeFactory <constructor>(java.nio.charset.Charset)