openrewrite / openrewrite/rewrite-apache
Spring 6+ upgrades trigger migration to HttpClient 5 – how to deal with undeclared dependency on HttpClient 4?
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 6
- Forks
- 19
- Avg merge
- 56m
- Merged PRs (30d)
- 3
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with discussion 4584 and the related change in openrewrite/rewrite-spring#566 to understand when the migration is triggered. Inspect the recipe and its dependency-detection behavior for projects where HttpClient 4 is only transitive. Done should be defined by a reproducible case and a verified strategy for handling the missing HttpClient 5 dependency.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100