https://kotlinlang.org logo
#ktor
Title
# ktor
s

Sergioedcigreja

06/26/2019, 3:12 PM
Hello, Is it possible to bundle all dependencies inside a jar to be imported to another project? My multiplatform project is building the jar but when I try to run on the application it says that a class from ktor was not found. I tried to use shadow jar to make a fat jar but it bundles kotlin's runtime with it as well, which leads to plenty of errors of duplicate classes. Any solution?
g

gildor

06/26/2019, 3:16 PM
Shadow plugin has DSL to exclude dependencies from bundling (also it's possible to repack/rename packages)
s

Sergioedcigreja

06/26/2019, 3:40 PM
Thank you will give that a go
y

Yan Pujante

06/26/2019, 4:01 PM
I spent a huge amount of time trying to make this work... you may want to check my build file https://github.com/ypujante/jamba-quickstart-server/blob/master/build.gradle
s

Sergioedcigreja

06/27/2019, 2:21 PM
Thank you for your answer but it still compiles kotlin's runtime with it which is not what I intend. This jar is to be imported to android kotlin applications so kotlin's runtime is useless there and gives me plenty of errors.
image.png
2 Views