[英]Maven Dependency version conflict : Elasticsearch and Lucene
My application uses Elasticsearch's transport client to connect to ES 1.7.2
cluster. 我的应用程序使用Elasticsearch的传输客户端连接到
ES 1.7.2
集群。 As per the documentation , it uses Lucene 4.10.4, so below are the dependency versions in my application: 根据文档 ,它使用Lucene 4.10.4,因此以下是我的应用程序中的依赖项版本:
Elasticsearch : 1.7.2
Lucene : 4.10.4
Now, I want to use a lucene based library ( here ) to perform in memory percolation. 现在,我想使用基于Lucene的库( 此处 )在内存渗透中执行。 Looking into the
pom.xml
of this, it seems it uses Lucene 6.3.0 libraries. 查看此文件的
pom.xml
,似乎它使用了Lucene 6.3.0库。 So, after adding this dependency, my application does not start up as Elasticsearch needs Lucene 4.10.4 and maven overrides it with 6.3.0, I have tried the following options: 因此,添加此依赖项后,我的应用程序无法启动,因为Elasticsearch需要Lucene 4.10.4,而maven用6.3.0覆盖了它,我尝试了以下选项:
Any other options? 还有其他选择吗?
You can try to exclude the dependency on lucene on your other library and hope that it works with version 4.x. 您可以尝试在其他库中排除对lucene的依赖,并希望它与4.x版一起使用。
in your maven pom, do 在您的行家里,做
<dependency>
<groupId>com.github.flaxsearch</groupId>
<artifactId>luwak</artifactId>
<version>1.4.0</version>
<exclusions>
<exclusion>
<groupId>[the lucene lib group]</groupId>
<artifactId>[the lucene lib artifact]</artifactId>
</exclusion>
</exclusions>
</dependency>
Technically, that's the way to solve version conflicts. 从技术上讲,这就是解决版本冲突的方法。 But there's no guarantee that the application can be built.
但是,不能保证可以构建该应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.