Guava not backward compatible

689 Views Asked by At

I have a few dependencies in my jar (spark-core and io.grpc) that are using two version of guava (19.0 and spark-core internally depending on hadoop mapreduce that uses 11.0.2) respectively. These two versions are not compatible with each other as few methods in one version are not available in other. How do I deal with maven dependencies in such a situation?

Dependency POM:

<dependency>
            <groupId>com.trueaccord.scalapb</groupId>
            <artifactId>scalapb-runtime_${scala.compat.version}</artifactId>
            <version>0.6.3</version>
        </dependency>
        <dependency>
            <groupId>com.trueaccord.scalapb</groupId>
            <artifactId>scalapb-runtime-grpc_${scala.compat.version}</artifactId>
            <version>0.6.3</version>
        </dependency>
        <dependency>
            <groupId>com.trueaccord.scalapb</groupId>
            <artifactId>compilerplugin_${scala.compat.version}</artifactId>
            <version>0.6.3</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-netty-shaded</artifactId>
            <version>1.10.1</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-tcnative-boringssl-static</artifactId>
            <version>2.0.5.Final</version>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>23.0</version>
        </dependency>


        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_2.11</artifactId>
            <version>2.2.1</version>
            <exclusions>
                <exclusion>
                    <artifactId>asm</artifactId>
                    <groupId>asm</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-sql_2.11</artifactId>
            <version>2.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-mllib_2.11</artifactId>
            <version>2.2.1</version>
        </dependency>

The question is more like a deadlock between the earlier and latest versions rather than a single error.

0

There are 0 best solutions below