Kotlin Native: Why are `implementation` dependenci...
# multiplatform
e
Kotlin Native: Why are
implementation
dependencies specified in submodules are exported when
transitiveExport = true
? Shouldn’t it only export dependencies marked with
api
?
c
Note: not an expert, I could be wrong Java doesn't have a concept of ‘static libraries', it only has ‘shared libraries'. That means that your jar only contains ‘references' to whatever library's jar you're using. Therefore, if that jar is not available at runtime, then your program can't run. The difference between implementation and API is whether or not developers that use your library see your dependencies in their auto-complete, etc. Essentially: • implementation: your dependencies appear in their runtime classpath • API: your dependencies appear in their runtime and compile-time classpath
e
I am talking about Kotlin Native not JVM. Edited the question*
c
Ah sorry, no idea then :/
l
@Elka, did you find the answer for that? I'm facing the same problem. When I look at the .pom generated for jvm, it is exported as runtime.
<dependency>
<groupId>com.embraer</groupId> <artifactId>ScapJava</artifactId> <version>3.4.1</version> <scope>runtime</scope> </dependency>
e
I had to disable transitiveExport and manually export the transitive ones, a bit ugly but works