https://kotlinlang.org logo
#serialization
Title
# serialization
s

sandwwraith

11/14/2018, 11:43 AM
Maybe a typo somewhere? Any differences from this pom? https://github.com/Kotlin/kotlinx.serialization/blob/master/example-jvm/pom.xml
v

ValV

11/14/2018, 11:57 AM
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

sandwwraith

11/14/2018, 12:01 PM
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

ValV

11/14/2018, 2:11 PM
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

sandwwraith

11/14/2018, 9:51 PM
It is, as the attached link shows
v

ValV

11/15/2018, 2:11 PM
@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

sandwwraith

11/15/2018, 7:22 PM
Can you post a bigger stacktrace, please?
I gave you link on 1.3.0 on Maven Central, is it wrong?
v

ValV

11/15/2018, 10:54 PM
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

sandwwraith

11/17/2018, 4:39 PM
First error message looks like incompatible versions, so yes, you should disable the old plugin and delegate build to Gradle.
v

ValV

11/17/2018, 5:46 PM
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

sandwwraith

11/18/2018, 9:14 PM
IDEA plugin is now bundled with the rest Kotlin distribution
5 Views