i’m really struggling to get the versions of kotli...
# gradle
b
i’m really struggling to get the versions of kotlin aligned on my project. i have:
Copy code
dependencies {
    implementation(enforcedPlatform("org.jetbrains.kotlin:kotlin-bom:1.5.10"))
    ...
}
but when i run
gradle dependencies
i see all sorts of nonsense like:
Copy code
+--- org.jetbrains.kotlin:kotlin-reflect:1.4.31 (*)
+--- org.jetbrains.kotlin:kotlin-bom:1.5.10
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.10 -> 1.4.31 (c)
|    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.10 -> 1.5.0 (c)
|    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.5.10 -> 1.5.0 (c)
|    +--- org.jetbrains.kotlin:kotlin-reflect:1.5.10 -> 1.4.31 (c)
|    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.10 -> 1.5.0 (c)
any suggestions to make this sane. one would think the BOM would be the appropriate approach.
e
dependencyInsight should tell you why
b
Copy code
> Task :eventbridge-client:dependencyInsight
org.jetbrains.kotlin:kotlin-reflect:1.4.31
   variant "runtime" [
      org.gradle.status                  = release (not requested)
      org.gradle.usage                   = java-runtime
      org.gradle.libraryelements         = jar
      org.gradle.category                = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling     = external
         org.gradle.jvm.environment         = standard-jvm
         org.jetbrains.kotlin.platform.type = jvm
         org.gradle.jvm.version             = 11
   ]
   Selection reasons:
      - Selected by rule
      - By constraint
      - Forced

org.jetbrains.kotlin:kotlin-reflect:1.4.31
\--- runtimeClasspath

org.jetbrains.kotlin:kotlin-reflect:1.5.10 -> 1.4.31
+--- com.someotherapp:some-dep:0.1.28
|    \--- runtimeClasspath
\--- org.jetbrains.kotlin:kotlin-bom:1.5.10
     \--- runtimeClasspath
why is some transitive causing my app to not respect the platform i’m defining?
t
probably better to ask this question in Gradle community slack
c
probably a bug in com.someotherapp:some-dep. maybe it uses enforcedPlatform too?
v
Actually I was told by a Gradle guy, that you should normally always prefer 
platform
 and only in rare edge cases 
enforcedPlatform
 is appropriate.
👍 1
c
gradle even warns when you publish a library that uses
enforcedPlatform