目录
问题一:
编辑
问题二:
解决:
问题一:
maven install 报错说找不到httpcore
问题二:
在项目运行时候找不到org.apache.http.annotation.ThreadSafe的类文件
解决:
1. 遇到该问题可能是httpcore和httpclient之间的版本冲突问题建议换成一下版本。
httpcore和 httpclient 推荐一下两个版本
<dependency>
<groupId>org.apache.Httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.4</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
2. 如果更换版本号还不行,建议去maven本地仓库检查是否下载了httpcore依赖;
2.1 以下步骤查看自己maven本地仓库的位置
2.2 手动推送依赖到本地仓库
httpcore-4.4.4.jar 的下载链接(阿里云盘)
2.2.1 推送jar到本地仓库的命令
mvn install:install-file -Dfile=C:/Users/Administrator/Desktop/a/httpcore-4.4.4.jar -DgroupId=org.apache.Httpcomponents -DartifactId=httpcore -Dversion=4.4.4 -Dpackaging=jar
maven语句解析:
mvn install:install-file -Dfile=<jar存放目录的全路径> -DgroupId=<pom依赖中的groupId> -DartifactId=<pom依赖中的artifactId> -Dversion=<版本号> -Dpackaging=jar
注意:
单独下载的maven可以打开cmd,cd到jar所在的目录运行该命令
idea集成的maven,按照以下方式运行命令
推送成功: