在运行测试以进行发布时,我最终会出现以下错误。
lang.NoSuchMethodError: org.apache.http.impl.client.DefaultHttpClient.execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/client/methods/CloseableHttpResponse;
做了一些研究并发现:http://ars-codia.raphaelbauer.com/2014/03/debugging-maven-classpath-problems.html
这是我的依赖:
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
HttpClient和HttpCore都是4.3.2。
我也玩过依赖项排除,但它没有用。