修复 wx-java-open-multi-spring-boot-starter 硬编码 HttpClient4 导致启动失败的问题#4060
Draft
Copilot wants to merge 2 commits into
Draft
修复 wx-java-open-multi-spring-boot-starter 硬编码 HttpClient4 导致启动失败的问题#4060Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
- 在 WxOpenMultiProperties.ConfigStorage 中新增 HttpClientType 枚举(APACHE_HTTP / HTTP_COMPONENTS)及 httpClientType 字段,默认值为 HTTP_COMPONENTS - 修改 AbstractWxOpenConfiguration.wxOpenService() 根据 httpClientType 选择对应的 WxOpenServiceApacheHttpClientImpl 或 WxOpenServiceHttpComponentsImpl - 修改 AbstractWxOpenConfiguration.configHttp() 仅在 httpClientType 为 APACHE_HTTP 时配置 DefaultApacheHttpClientBuilder,消除对 HttpClient4 的强制依赖 Closes #4059
Copilot
AI
changed the title
[WIP] Fix HttpClient version dependency issue in wx-java-open-multi-spring-boot-starter
修复 wx-java-open-multi-spring-boot-starter 硬编码 HttpClient4 导致启动失败的问题
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AbstractWxOpenConfiguration.configHttp()无条件实例化DefaultApacheHttpClientBuilder(HttpClient 4.x),而默认服务实现WxOpenServiceImpl实际使用 HttpClient 5.x,导致未显式引入 HttpClient4 依赖的项目启动时抛出NoClassDefFoundError: org/apache/http/conn/HttpClientConnectionManager。变更内容
WxOpenMultiProperties:新增HttpClientType枚举(APACHE_HTTP/HTTP_COMPONENTS),并在ConfigStorage中添加httpClientType字段,默认值为HTTP_COMPONENTSAbstractWxOpenConfiguration:wxOpenService()根据httpClientType动态选择WxOpenServiceApacheHttpClientImpl或WxOpenServiceHttpComponentsImplconfigHttp()仅在httpClientType == APACHE_HTTP时才配置DefaultApacheHttpClientBuilder默认行为与原来一致(HttpClient 5.x),无需修改现有配置。如需切换至 HttpClient 4.x: