rife2/bld

Invalid dependency resolution

Closed this issue · 1 comments

Looking at the following dependency tree:

compile:
├─ com.uwyn.rife2:rife2:1.7.1
├─ com.uwyn.rife2:rife2-renderers:1.1.2
├─ jakarta.servlet:jakarta.servlet-api:6.0.0
├─ net.thauvin.erik:readingtime:0.9.1
│  └─ org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10
│     ├─ org.jetbrains.kotlin:kotlin-stdlib:1.7.10
│     │  ├─ org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10
│     │  └─ org.jetbrains:annotations:13.0
│     └─ org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10
├─ net.thauvin.erik:shortener:0.4.0
└─ net.thauvin.erik:social:2.0.30
   ├─ com.github.jtidy:jtidy:1.0.5
   ├─ com.github.scribejava:scribejava-apis:8.3.3
   │  ├─ com.fasterxml.jackson.core:jackson-databind:2.14.0
   │  │  ├─ com.fasterxml.jackson.core:jackson-annotations:2.14.0
   │  │  └─ com.fasterxml.jackson.core:jackson-core:2.14.0
   │  └─ com.github.scribejava:scribejava-core:8.3.3
   │     └─ com.github.scribejava:scribejava-java8:8.3.3
   ├─ com.restfb:restfb:2023.12.0
   ├─ com.squareup.okhttp3:okhttp:4.11.0
   │  └─ com.squareup.okio:okio:3.2.0
   │     └─ com.squareup.okio:okio-jvm:3.2.0
   ├─ commons-codec:commons-codec:1.16.0
   ├─ net.thauvin.erik:bitly-shorten:1.0.0
   ├─ net.thauvin.erik:pinboard-poster:1.1.0
   ├─ net.thauvin.erik:utils:0.9.0
   ├─ org.json:json:20230618
   └─ org.jsoup:jsoup:1.16.1

bld is using version 1.7.10 of the Kotlin standard libs, which are needed by readingtime.

Yet, for example, the bitly-shorten dependency is needing version 1.9.10 of the same Kotlin libraries.

The workaround is to include bitly-shorten as a direct dependency.

This behavior matches Maven's dependency resolution, which picks the latest version with the shortest path. Including the latest version of the Kotlin std library is the best solution:

.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib-jdk8", version(1,9,10)))