简体   繁体   English

如何将同一个程序包的多个版本作为项目的间接依赖项?

[英]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.

相关问题 如何将来自间接依赖项目的版本合并到一个项目中 - How to combine versions from indirect dependent projects into a single project 当将同一库的多个版本声明为依赖项时,Maven项目中将加载哪个类? - Which class is loaded in a Maven project when multiple versions of same library are declared as dependencies? 如何 package spring 启动具有多个 JAR 依赖项的项目? - How to package spring boot project with multiple JAR dependencies? 我怎样才能有单独的 gradle 项目的调试和发布版本,它们可以引入相同 class 的不同版本? - How can I have separate debug and release versions of gradle project that pull in different versions of the same class? Maven - 如何使用多个版本的依赖项? - Maven - how to work with multiple versions of dependencies? 在同一个maven项目中使用多个Guava版本 - Use multiple Guava versions in same maven project 对应用程序正常运行所需的相同依赖项的多个版本进行着色 - Shading multiple versions of same dependencies required for functioning application Android:如果在同一个项目中使用,Java 和 Kotlin 是否应该具有相同的版本? - Android: Should Java and Kotlin have the same versions if used in the same project? 如何使用Eclipse将依赖项打包到Java项目中 - How to package dependencies into java project with eclipse 如何将旧项目依赖版本更新到最新的 android studio? - How to update old project dependencies versions into latest android studio?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM