'Maven picking up old dependencies

I have a multi-module project with a complicated set of dependencies arising from inheriting from a large parent POM (like an "include everything" POM that is used by all of our company's projects) and including a number of our company's dependencies which themselves include many transitive dependencies.

My problem is I want to use the latest Kotlin 1.6.10. I have this in my main pom.xml:

<dependencies>
    <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-stdlib-jdk8</artifactId>
        <version>1.6.10</version>
    </dependency>
</dependencies>

But I notice that my Kotlin classes and functions are still taken from the older Kotlin 1.5.31. When I do mvn dependency:tree I see the following:

[INFO] \- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.6.10:compile
[INFO]    +- org.jetbrains.kotlin:kotlin-stdlib:jar:1.5.31:compile
[INFO]    |  +- org.jetbrains:annotations:jar:13.0:compile
[INFO]    |  \- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.5.31:compile
[INFO]    \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.5.31:compile

This is the only section that mentions the Kotlin standard library. There are no direct inclusions of kotlin-stdlib.jar, only as a transitive dependency of kotlin-stdlib-jdk8.jar. So why does kotlin-stdlib-jdk8.jar 1.6.10 include kotlin-stdlib.jar 1.5.31? This doesn't happen with my personal projects - there, it's all 1.6.10 for everything. What Maven goals or other techniques are available to investigate what is causing 1.5.31 to be pulled in?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source