java - Maven Spring Boot 应用程序找不到 org.apache.http
问题描述
我的 Spring Boot 应用程序需要调用 RESTful 服务,我想使用 apacheHttpClient
来执行此操作。我在 pom.xml 中添加了依赖(尝试了不同的版本)
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.0</version>
</dependency>
但即使我可以看到在构建过程中下载了 .jar 文件:
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.0/httpclient-4.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.0/httpclient-4.0.pom (6.0 kB at 14 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpcomponents-client/4.0/httpcomponents-client-4.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpcomponents-client/4.0/httpcomponents-client-4.0.pom (9.8 kB at 138 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.0/httpclient-4.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.0/httpclient-4.0.jar (290 kB at 1.1 MB/s)
但是在代码中我无法访问它的任何内容:
我在这里想念什么?
解决方案
试试:文件| 使缓存无效/重新启动其他保存所有内容...重新启动 IntelliJ
推荐阅读
- asp.net-mvc - 如何从视图获取变量到控制器?
- typo3 - Typo3 fe_login 表单未显示在前端
- wpf - 如何更改要使用的数据库的路径?
- postgresql - 如何在 postgres 9.6 中创建 pg_background 扩展?
- perl - 将字符串转换为 CRC-32 时的不同结果
- c# - C# 如何使用 SignedXml 使用 XAdES 正确签署消息?
- javascript - 反应原生 | 将 prop 值传递给 setState
- java - 如何将活动的弱接口类型传递给单例类
- wpf - WPF:双值上的 StringFormat 无法识别自定义窗口区域设置
- python - 为什么 enable_automatic_punctuation=true 在 python 3 中给出错误