I’m having a bit of trouble with the gradle shadow plugin
com.github.johnrengelman.shadow
I’m trying to create a fat JAR from various kotlin modules and my attempts to exclude transitive dependencies don’t seem to be working. My output JAR is truly fat at 820mb.
I’ve tried doing this, which is what I think I need:
dependencies {
implementation(project(":brainLib")) {
transitive = false
}
}
But I get the error:
Could not determine the dependencies of task ':brainLib:compileKotlinJvm'.
> Could not resolve all dependencies for configuration ':brainLib:jvmCompileClasspath'.
> Cannot change dependencies of dependency configuration ':brainLib:commonMainApi' after it has been included in dependency resolution.
I also tried this, which is supposed to be like a “keep” rule in proguard, but that didn’t work either. (I think because the huge dependencies are transitive under brainLib).
shadowJar {
minimize {
exclude(project(":brainLib"))
}
}
Are there other suggestions as to what I could try?