Drools 6 sisu-guava conflicts with guava

不打扰是莪最后的温柔 提交于 2019-12-12 12:23:10

问题


We have recently upgraded from Drools 5 to Drools 6 and have run into disturbing conflict issues.

We have kie-ci imported into out project. kie-ci brings in sisu-guava. sisu-guava changes the accessibility of some of the classes from google's guava. Unfortunately, it uses the same package name as google's guava.

Since we're working with google's guava in our project, we are running into conflicts of classes. An attempt to remove sisu-guava from the project (using a maven exclusion) results in accessibility exceptions, as the kie-ci code attempt to access classes which are public in sisu-guava but are private in google's guava.

Any idea how to get round this.


回答1:


This may not be correct solution for all situation, but I was able to resolve this issue by excluding the susi-guava jar in my pom:

    <dependency>
        <groupId>org.jbpm</groupId>
        <artifactId>jbpm-kie-services</artifactId>
        <version>${jbpm.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.sonatype.sisu</groupId>
                <artifactId>sisu-guava</artifactId>
            </exclusion>
        </exclusions>
    </dependency>



回答2:


I seem to have the same problem using drools 6.2. Drools is dependent on guava 10.0.1, where as my project had a dependency on guava 16 and maven was picking the version 16 (correctly).

On inspecting the dependency tree, I find that the drools dependency on guava is dictated by "org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.0.0.M5:runtime".

There is a newer version of org.eclipse.sisu.plexus, so I added the following to my project's pom to pick up the latest version, which is:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.eclipse.sisu</groupId>
      <artifactId>org.eclipse.sisu.plexus</artifactId>
      <version>0.3.1</version>
    </dependency>
  </dependencies>
</dependencyManagement>

Now, there does not seem to be a dependency on guava, for drools and the problem is solved and my project can use version 16 of guava.



来源:https://stackoverflow.com/questions/25870519/drools-6-sisu-guava-conflicts-with-guava

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!