Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Grails依赖Lucene的噩梦_Grails_Lucene_Dependencies - Fatal编程技术网

Grails依赖Lucene的噩梦

Grails依赖Lucene的噩梦,grails,lucene,dependencies,Grails,Lucene,Dependencies,我最近将Elastic Search从0.90.0更新到1.3.2,现在我与另一个依赖项使用的Lucene版本发生冲突。场景如下所示: JARA使用Lucene 4.9.0 JARB使用Lucene 3.3.0 关键是我得到了一个java.lang.VerifyError,因为B代码覆盖了Lucene类的final方法,而该方法在4.9.0版本中不是final 我尝试过这个,但没有成功: compile ('A') compile ('B') compile ('org.apache.lucen

我最近将Elastic Search从0.90.0更新到1.3.2,现在我与另一个依赖项使用的Lucene版本发生冲突。场景如下所示:

JARA使用Lucene 4.9.0 JARB使用Lucene 3.3.0

关键是我得到了一个java.lang.VerifyError,因为B代码覆盖了Lucene类的final方法,而该方法在4.9.0版本中不是final

我尝试过这个,但没有成功:

compile ('A')
compile ('B')
compile ('org.apache.lucene:lucene-core:4.9.0') {
    excludes(B)
}
compile ('org.apache.lucene:lucene-analyzers-common:4.9.0') {
    excludes(B)
}
我不知道还能做什么,有什么线索吗


谢谢

假设您想要最新版本的Lucene,您的排除实际上是反向的

您的B声明应该如下所示:

compile ('B') {
    excludes "lucene-core", "lucene-analyzers-common"
}
在该列表中也包括可能冲突的任何其他lucene罐子

如果您的代码中除了elasticsearch插件之外没有专门使用任何lucene库,那么可以删除显式lucene声明


我对Lucene的了解还不足以告诉您4.9.0是否与3.3.0向后兼容,但这个解决方案至少应该确保4.9.0是项目类路径上的内容,而不是3.3.0

问题是B正在重新定义一个在Lucene 3.3.0中是最终的方法,但在4.9.0中不是最终的方法,因此,我得到了一个java.lang.VerifyError,因为这样:如果3.3.0仍然在类路径上,这是有意义的。您能确认它不再在类路径上吗?哪个代码实际上抛出了VerifyError?编写VerifyError的代码是位于B中的一个代码,它扩展了Lucene的Analyzer类,并重新定义了一个方法,该方法在3.3.0中是最终的,在4.9.0中不是最终的。所以如果3.3.0不再在类路径上,这个验证错误应该会消失。谢谢大家,所以我想我这里有个问题。。。创建一个包含B及其依赖项的uber jar怎么样?