Hi , is there something wrong with `ktor-client-se...
# ktor
s
Hi , is there something wrong with
ktor-client-serialization
(1.5.1) to
kotlinx-serialization-json
dependency ? I tried
Copy code
<dependency>
    <groupId>io.ktor</groupId>
    <artifactId>ktor-client-serialization</artifactId>
    <version>${ktor_version}</version>
</dependency>
but IntelliJ & maven always complains
Cannot resolve org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.1
command line mvn complains :
Copy code
Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact org.jetbrains.kotlinx:kotlinx-serialization-json:jar:1.0.1 in central (<https://repo.maven.apache.org/maven2>)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies (DefaultRepositorySystem.java:352)
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:202)
And in maven center https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-serialization-json/1.0.1/ There is no jar file . That’s why maven complains it cannot find JAR file. KSJ is packaging in POM , not JAR https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-serialization-json/1.0.1/kotlinx-serialization-json-1.0.1.pom
Copy code
<packaging>pom</packaging>
Is it OK to import it like this ? https://repo1.maven.org/maven2/io/ktor/ktor-client-serialization/1.5.1/ktor-client-serialization-1.5.1.pom
Copy code
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-serialization-json</artifactId>
<version>1.0.1</version>
<scope>compile</scope>
</dependency>
Sorry not sure about this. but it seems not working. Is it maven center’s problem ?
j
Not sure if that's the same problem, but try to set dependency on
ktor-client-serialization-jvm
, not
ktor-client-serialization
s
wow , it works ! thanks. It seems ktor’s document should fix it
j
Yeah. Would be great if that'd be the only problem with ktor's documentation 😕
😅 2