0

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.

Nagireddy Hanisha
  • 1,290
  • 4
  • 17
  • 39
  • Show your dependencies here please (directly from the maven/gradle file) – Olivier Grégoire May 31 '18 at 07:37
  • https://stackoverflow.com/questions/36427291/illegalaccesserror-to-guavas-stopwatch-from-org-apache-hadoop-mapreduce-lib-inp Lika's answer to the above post has resolved my issue!. – Nagireddy Hanisha May 31 '18 at 12:35
  • Possible duplicate of [IllegalAccessError to guava's StopWatch from org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus](https://stackoverflow.com/questions/36427291/illegalaccesserror-to-guavas-stopwatch-from-org-apache-hadoop-mapreduce-lib-inp) – Olivier Grégoire May 31 '18 at 12:46

0 Answers0