0

Am using a kafka-client dependency in my project abc-bus-api. The version is 2.1.0. See below.

    <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-clients</artifactId>
        <version>2.1.0</version>
        <exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

enter image description here

Now this above project is a dependency in another project abc-lib. Here i see a different kafka-client version than what i have specified in my abc-bus-api. See below.

enter image description here

maven tree in STS (for kafka):

enter image description here

Any guess what am doing wrong here.

ProgrammerBoy
  • 876
  • 6
  • 19
  • Multiple dependencies seem to be pulling in `kafka-clients` as a dependency, and the 1.x/2.x is likely to be a problem. Try `mvn dependency:tree`. – chrylis -cautiouslyoptimistic- Jan 14 '19 at 06:11
  • I updated my question. You can see the tree view in STS. – ProgrammerBoy Jan 14 '19 at 06:36
  • 1
    Have you checked the parent module of your abc-bus-api? From "managed from 2.1.0", I think it has a to define the version for all children modules. – MageXellos Jan 14 '19 at 06:42
  • Looks like your abc-bus-api project has another dependency which depends on the older version of kafka-clients. You can verify this based on your effective pom or dependency tree for your project. In addition you can check this link: https://dzone.com/articles/solving-dependency-conflicts-in-maven. I think it might help you. – Simrandeep Singh Jan 14 '19 at 06:49
  • thanks for the direction. It was due to abc-lib. It has "spring-boot-dependencies" dependency(version 2.0.5.RELEASE) in dependency management and this uses a old version of kafka. Upgrading this solved it. Appreciate your help. @MageXellos. – ProgrammerBoy Jan 14 '19 at 06:50

0 Answers0