Repository navigation
Dependencies are working only with jdk8 #239
Description
Activity
Duplicate of #239
Reacted by nezed- marked this as a duplicate of Dependencies are working only with jdk8 #239
on Sep 2, 2019 Recursive duplicated issue :). @holgerbrandl, could you specify duplicated issue, please? I can find nothing similar by myself and I would like to follow it.
Let's blame the early Monday morning. :-)
Let's test this with the recent dev builds from here - https://bintray.com/kotlin/kotlin-dev/kotlin because it seems related to https://youtrack.jetbrains.com/issue/KT-26624
Any news on that problem? It still does not work (Java 11).
This week is super packed on my end, but I'll try to look into at the weekend. It goes without saying that PRs are welcome.
I wanted to retest it on 1.3.61 to see if KT-26624 fixes it, however for some reason KScript reports using Kotlin 1.2.41 (via
KotlinVersion.CURRENT) even though that version is not (AFAICS) installed on my computer.Is that version set at compile-time for KScript and immutable for anyone running it?
Sorry - pls ignore. Ironically one of the (already resolved) script dependencies was pulling in the old version of kotlin-stdlib. (So, unsurprisingly I guess
KotlinVersion.CURRENTis defined in kotlin-stdlib).At the moment, it doesn't appear that 1.3.61 resolves the issue.
Is there any way of confirming which version of
kotlincis being used by kscript?Sure,
which kotlinc. Under the hood, it's just creating a subprocess which is inferring the kotlinc to be used from your PATH. Afaik the only way to overrule this behaviour is declaring a KOTLIN_HOME variable in the shell environment where kscript is launched.We were discussing if we should rather use the compiler API (see #102), but there were pros and cons but imho no major functional advantage, so the PR is still unresolved.
Thanks. Yes, I can confirm that Java 11 still causes the NoClassDefFoundError for
org/ietf/jgss/GSSExceptionon Kotlin 1.3.61As an alternative approach, I attempted to include the
java.security.jgssmodule via the approaches included in https://github.com/holgerbrandl/kscript/blob/master/examples/java_module_example.kts but none of them solved the issue.Hi,
I am also seeing the exact same issue (
java.lang.NoClassDefFoundError: org/ietf/jgss/GSSException) when using kscript with dependencies in a Github Actions pipeline that runs with Java 11 (the Java 8 version of the pipeline works just fine).@qmg-dhamilton I think the problem is that somehow the GSSException class is needed by kscript itself when resolving dependencies via jcabi. Dependencies in a user script such as the java_module_example are unrelated to that issues.
I've filed a ticket in jcabi-aether to narrow down the root cause of the problem. See jcabi/jcabi-aether#105
Feel welcome if you have ideas about how to fix this annoying issue.
30 remaining items
glad to hear this issue may soon be resolved now that 1.4 is out. I'm itching to run kscript as primary scripting language to perform db calls. And for that I need it to be able to fetch say mysql:mysql-connector-java:8.0.19, and to finally be able to run with jdk9+ modules like -Xadd-modules=java.sql
Reacted by Ivan “CLOVIS” Canet and zaxebo1@holgerbrandl With 1.4 being officially released, any updates on this?
Reacted by zaxebo1 and MishaReacted by zaxebo1@ligee Are there examples and/or documentation about how to use the new resolver API?
@holgerbrandl, there is no documentation, unfortunately. Examples could be found here - https://github.com/Kotlin/kotlin-script-examples/blob/master/jvm/basic/jvm-maven-deps/MavenDeps.md and in the library tests - https://github.com/JetBrains/kotlin/blob/1.4.0/libraries/scripting/dependencies-maven/test/kotlin/script/experimental/test/MavenResolverTest.kt
Those official examples are a bit of a pain to use, we need to download a JAR with the annotations, etc. It'd be nice if this project could fix these issues and make this convenient :)
@CLOVIS-AI if you mean examples in the https://github.com/Kotlin/kotlin-script-examples repo - I'm not sure I understand what you mean. If you have some particular issues, please report them on the project page.
Sorry, I meant that the official Kotlin way of using scripts is a bit weird to implement and undocumented, and I really like kscript's system since it's much more straightforward, but it also doesn't work currently :/
- added a commit that references this issue
on Nov 1, 2020 I've changed the dependency resolver to use the provided api in kotlin 1.4 instead of aether in branch https://github.com/holgerbrandl/kscript/tree/fix239
There are 2 failing tests, which I'd love to address before rolling out a new release:
- It does not seem to resolve pom dependencies, see test https://github.com/holgerbrandl/kscript/blob/master/test/resources/depends_on_with_type.kts
- It does not seem to resolve dynamic dependencies. see test https://github.com/holgerbrandl/kscript/blob/master/test/resources/depends_on_dynamic.kts and https://docs.gradle.org/current/userguide/dynamic_versions.html
@ligee are these types of dependencies covered by the current implementation?
@ligee How is authentification supported? There don't seem to be any user/pw arguments in
RepositoryCoordinatesnor could I find an example for authentification yet.Reacted by Martin Bonnin, Dan Ben and Emil Orvik Kollstrøm@holgerbrandl, here is a test for a pom dependency that seems working to me - https://github.com/JetBrains/kotlin/blob/master/libraries/scripting/dependencies-maven/test/kotlin/script/experimental/test/MavenResolverTest.kt#L74, and test for the version range is around too. There is no specific test for the dynamic version, but the coordinates are parsed by aether lib, so I suppose it should work the same way as for cli
mvntool.As of authentication - you can try to use a subclass of
RepositoryCoordinates-MavenRepositoryCoordinates(https://github.com/JetBrains/kotlin/blob/master/libraries/scripting/dependencies-maven/src/kotlin/script/experimental/dependencies/maven/MavenDependenciesResolver.kt#L27) which have auth fields (only plain text creds are supported at the moment). There is no corresponding test in the kotlin repo, but I have been told that it works for the https://github.com/Kotlin/kotlin-jupyter project, please have a look.
Using >8 JDK everything is working except dependency resolution:
A first bug was reported #233
jdk8 is 5 years old and some people prefer to use newer versions of jdk.