openrewrite/rewrite-apache

Spring 6+ upgrades trigger migration to HttpClient 5 – how to deal with undeclared dependency on HttpClient 4?

Open

#35 opened on Oct 16, 2024

 (5 comments) (0 reactions) (0 assignees)Java (20 forks)auto 404
bugenhancementgood first issuerecipe

Repository metrics

Stars
 (6 stars)
PR merge metrics
 (PR metrics pending)

Description

Discussed in https://github.com/openrewrite/rewrite/discussions/4584

Originally posted by @DidierLoiseau October 16, 2024 I noticed an issue with this migration, which is triggered transitively by Spring Boot 3+ upgrades since openrewrite/rewrite-spring#566: HttpClient 4 is a relatively common dependency, so people often use it without even realizing it is pulled transitively by another dependency, and they don’t declare HttpClient as an explicit dependency.

The problem with this migration is that it will update the code without adding the HttpClient 5 dependency if HttpClient 4 was missing.

Is there a way around this?

Contributor guide