Maybe a typo somewhere? Any differences from this ...
# serialization
s
Maybe a typo somewhere? Any differences from this pom? https://github.com/Kotlin/kotlinx.serialization/blob/master/example-jvm/pom.xml
v
Few differences: 1. I have no
maven-compiler-plugin
and
maven-exec-plugin
2. I have 2 additional dependencies:
tornadofx
and
kotlin-test
3. For
kotlin-maven-plugin
jvmTarget
is being set inside
<plugin><executions><execution><configuration>
4.
<packaging>
into
pom
, not
jar
as in the example
With version
0.6.2
that worked just fine
It is painful to update Maven repository, 'cause it takes too long while downloading 500+ MiB of archives
Each time
s
Then it should work fine, a single difference from 0.6.2 plugin was group change from
kotlinX
to
kotlin
. There's this artifact: https://search.maven.org/artifact/org.jetbrains.kotlin/kotlinx-maven-serialization-plugin/1.3.0/jar
v
Yep, I've noticed that change. So the problem is somewhere in Maven repository
Hmm...
find ~/.m2 -type f -name '*seralization*0.9.0*jar'
returned
org/jetbrains/kotlinx/kotlinx-serialization-runtime/0.9.0/kotlinx-serialization-runtime.jar
+ the same for
*runtime-common*
And that's all -- just 2 jars
Where does
kotlinx-maven-serialization-plugin
reside? Maybe it's not in maven-central?
s
It is, as the attached link shows
v
@sandwwraith this problem is fixed by setting
kotlin.version
to
1.3.10
, not
1.3.0
. For some reason Maven does not find
org.jetbrains.kotlin:kotlinx-maven-serialization-plugin:1.3.0
in its Central
But another problem occurs:
[Internal Error] Exception while analyzing expression
-- just where the first
@Serializable
class must return its
serializer().list
s
Can you post a bigger stacktrace, please?
I gave you link on 1.3.0 on Maven Central, is it wrong?
v
I'd better say that
1.3.0
not wrong, but it did not work for me (with IDEA). Here is the stacktrace for the new exception
I have disabled Kotlin-serialization IDEA plugin (it was version
0.6.2
), even with that plugin disabled the error persists
Well, I tried to compile the project without IDE(A) at all, and Maven gave more comprehensive errors
Looks like I've missed many changes from
0.6.2
to
0.9.0
, so no more contexts?
Yet still I don't understand what's wrong in
41:32
. Shall I use some interface instead of
@Serializable
?
s
First error message looks like incompatible versions, so yes, you should disable the old plugin and delegate build to Gradle.
v
So I need serialization plugin for IDEA, now? Just like that disabled for
0.6.2
but for the new
0.9.0
(I haven't find it yet), 'cause with Maven the project builds, but with IDEA it feeds me with the
Internal Error
s
IDEA plugin is now bundled with the rest Kotlin distribution