Skip to content
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

'api' dependencies have wrong 'runtime' scope in pom.xml #32

Open
davidvavra opened this issue Jan 23, 2025 · 4 comments
Open

'api' dependencies have wrong 'runtime' scope in pom.xml #32

davidvavra opened this issue Jan 23, 2025 · 4 comments

Comments

@davidvavra
Copy link

Hello, thanks for this great library.

I have transitive dependencies in my KMP library, they are marked as 'api' instead of 'implementation'. However when published locally or to Maven Central, they are marked as 'runtime' instead of 'compile' in pom.xml. Which forces the library user to add these transitive dependencies manually.

The library is open-source here: https://github.com/step-up-labs/spayd-kmp

Dependencies I'm talking about:

api(libs.bignum)
api(libs.kotlinx.datetime)

which maps to POM:

<dependencies>
    <dependency>
      <groupId>com.ionspin.kotlin</groupId>
      <artifactId>bignum</artifactId>
      <version>0.3.10</version>
      <scope>runtime</scope>
  </dependency>
  <dependency>
      <groupId>org.jetbrains.kotlinx</groupId>
      <artifactId>kotlinx-datetime</artifactId>
      <version>0.6.1</version>
      <scope>runtime</scope>
  </dependency>
</dependencies>

Is this a bug in maven deployer or could you please point me in some direction which might fix the issue?

@natario1
Copy link
Member

We don't modify dependencies, it may be a Kotlin Gradle Plugin bug.

Could you try publishing to a local repository without MavenDeployer and see if it still has the wrong scope? https://kotlinlang.org/docs/multiplatform-publish-lib.html

Most likely you just have to run some publish*() task.

@davidvavra
Copy link
Author

davidvavra commented Jan 23, 2025

You are right. When I try to publish with maven-publish plugin and command gradle publishToMavenLocal, it also creates dependencies with runtime scope. Do you have advice where I should report this?

@natario1
Copy link
Member

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

No branches or pull requests

2 participants