原文:https://blog.csdn.net/xiehuanhuan1991/article/details/79914581?utm_source=blogxgwz0
之前做微信网页授权时,要访问他的url,于是要有httpclient
CloseableHttpClient client = HttpClientBuilder.create().build();
但是运行时tomcat报错NoClassDefFoundError: org/apache/http/ssl/SSLContexts
解决办法引入依赖:
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
这里要注意httpcore一定要4.4及以上版本的。