Kotlin / kotlin-interactive-shell

Kotlin Language Interactive Shell
Apache License 2.0
587 stars 36 forks source link

:dependsOn does not load transitive dependencies #109

Closed NorbertSandor closed 2 years ago

NorbertSandor commented 2 years ago

It seems that only the direct dependency is loaded, its transitive dependencies are not. This makes even slightly complex dependencies unusable without lots of manual work :(

Embedding Maven Artifact Resolver would probably help a lot in the implementation.

asm0dey commented 2 years ago

Hi @NorbertSandor!

Could you give us an example please? Adding Maven Artefact Resolver is definitely not an option: it's too heavyweight (we've been considering it for some time)

NorbertSandor commented 2 years ago

It was my own library that had lots of transitive dependencies, and none of them was resolved/loaded (eg. kotlinx-datetime, kotlinx-coroutines, ...). I gave up trying and searched for another solution :( Thanks for your response :)

NorbertSandor commented 2 years ago

Adding Maven Artefact Resolver is definitely not an option

Without transitive dependency resolution, :dependsOn is useable only for very basic libraries :(

it's too heavyweight

I haven't used it yet, it was just an idea to use the "official" tool. (Full-blown dependency resolution is not a simple task - maybe that's why it seems overly complex...)

asm0dey commented 2 years ago

But they all are available in the repository? May I ask you to give me coordinates of the dependency please?

NorbertSandor commented 2 years ago

It was only in my local Maven repository. It seemed that the library itself has been found but its dependencies were not resolved (ClassNotFoundError or NoClassDefFoundError at runtime when I tried to invoke functions from the library - sorry, I don't remember which one).

asm0dey commented 2 years ago

Yeah, maybe it's an issue with it being local repo. I'm almost sure it works for remote ones. Still an issue tho