Skip to content

Add dependency on JVM version of the library to the POM file #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ileasile opened this issue Dec 17, 2021 · 4 comments
Open

Add dependency on JVM version of the library to the POM file #167

ileasile opened this issue Dec 17, 2021 · 4 comments
Labels
usage Build problems in client projects
Milestone

Comments

@ileasile
Copy link

We in Kotlin Jupyter kernel use Maven resolver for libraries resolution. Maven POM for kotlinx.datetime lacks any information of kotlinx-datetime-jvm dependency: https://repo1.maven.org/maven2/org/jetbrains/kotlinx/kotlinx-datetime/0.3.1/kotlinx-datetime-0.3.1.pom.
So, when we import library like this:

@file:DependsOn("org.jetbrains.kotlinx:kotlinx-datetime:0.3.1")

we end up with an almost empty JAR without .class files, it only contains metadata files.

This fixes the issue:

@file:DependsOn("org.jetbrains.kotlinx:kotlinx-datetime-jvm:0.3.1")

The problem will be solved if the runtime dependency on kotlinx-datetime-jvm will be added to the POM file. I think, similar problem arises in Maven projects as well.

@ilya-g
Copy link
Member

ilya-g commented Dec 23, 2021

In Maven JVM projects you should depend explicitly on kotlinx-datetime-jvm variant, like you do with any other Kotlin/MPP library.

I don't know the details behind @file:DependsOn dependency resolution mechanism, but probably it could be taught to support Gradle metadata in some limited form to resolve the correct dependency variant.

@dkhalanskyjb dkhalanskyjb added the usage Build problems in client projects label Dec 1, 2023
@dkhalanskyjb
Copy link
Collaborator

@dkhalanskyjb
Copy link
Collaborator

It turns out there's some problem with the way we do it in coroutines: Kotlin/kotlinx.coroutines#3842. We'll need to look into it before we decide whether the datetime library should do the same.

@dkhalanskyjb dkhalanskyjb added this to the 0.7.0 milestone Apr 12, 2024
@JakeWharton
Copy link

Seems like the main artifact should be the JVM jar with the Gradle module metadata. Then the common artifact is a separate artifact ID, like how the stdlib works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usage Build problems in client projects
Projects
None yet
Development

No branches or pull requests

5 participants
@JakeWharton @ilya-g @ileasile @dkhalanskyjb and others