[英]How to have multiple versions of the same package as the indirect dependencies of a project?
I'm working on a project which connects to Elasticsearch 5.2.1 and Neo4j 3.1.0 at the same time. 我正在研究一个同时连接到Elasticsearch 5.2.1和Neo4j 3.1.0的项目。 These two packages both make use of Lucene but unfortunately incompatible versions.
这两个软件包都使用Lucene,但不幸的是不兼容的版本。 Elaticseach needs Lucence 6.4.1 and Neo4j works with Lucene 5.5.0.
Elaticseach需要Lucence 6.4.1,Neo4j与Lucene 5.5.0兼容。
As the result, I'm facing with runtime errors since some of the classes have incompatible signatures. 结果,由于某些类的签名不兼容,我遇到了运行时错误。 Is there any way I can have both Elasticsearch and Neo4j (with the given versions) in one project?
有什么办法可以在一个项目中同时拥有Elasticsearch和Neo4j(具有给定的版本)?
What I'm trying to do is to add Elasticsearch package to this project . 我想要做的是将Elasticsearch软件包添加到该项目中 。 And here are the Elasticsearch dependencies that I added:
这是我添加的Elasticsearch依赖项:
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>5.2.1</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>5.2.1</version>
</dependency>
How can I make these two to play alongside of each other nicely? 我怎样才能使这两个很好地相互配合?
jar的每个组合都应打包在具有依赖项或war的不同jar中,并且它们不应共享同一父类加载器,以便在具有依赖项或war的jar的两个不同版本中退出的已加载类由不同的classloader加载。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.