前提:同时使用了ESClient和Apache-Mahout。
<!--ESClient依赖-->
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
</dependency>
<!--##Apache-Mahout依赖##-->
<dependency>
<groupId>org.apache.mahout</groupId>
<artifactId>mahout-core</artifactId>
<version>0.9</version>
</dependency>
运行项目报错:
原因:ESClient和Apache-Mahout都依赖lucene包,但是ESClient依赖的lucene版本在5.0以上,而Mahout依赖的lucene版本是4.6.1,而且正好就覆盖了ESClient的包,这就导致ESClient找不到Accountable类。
解决:直接排除mahout的依赖。
<!--##Apache-Mahout依赖##-->
<dependency>
<groupId>org.apache.mahout</groupId>
<artifactId>mahout-core</artifactId>
<version>0.9</version>
<exclusions>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
</exclusion>
</exclusions>
</dependency>