Open unclechu opened 3 months ago
The answer to your question is in the second part of the exception message:
and that the serialization compiler plugin is applied.
Given that you're invoking the compiler manually, passing -Xplugin
argument to it is required. Serialization compiler plugin is a separate jar that is not a part of runtime. You can find it using these coordinates: https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-serialization-compiler-plugin or in ${KOTLIN_HOME}/lib/kotlin-serialization-compiler-plugin.jar
This ticket contains more information: https://youtrack.jetbrains.com/issue/KT-47384
Describe the bug
I have a simple Kotlin script (
foo.kts
):I start it like this:
Where in Gradle I have this task:
This is a bit fancy, just wanted to set the CLASSPATH and avoid constantly invoking Gradle but still have dependencies included for the script. The problem is that I keep getting this error:
Even though
@Serializable
annotation is added for the class.Environment
Kotlin version 1.9.255-SNAPSHOT (JRE 21+35-nixos)