Skip to content

Library cannot be used due to split package exported by dependencies #3769

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
cowwoc opened this issue Oct 25, 2024 · 8 comments
Open

Library cannot be used due to split package exported by dependencies #3769

cowwoc opened this issue Oct 25, 2024 · 8 comments
Assignees
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@cowwoc
Copy link

cowwoc commented Oct 25, 2024

Describe the bug
This library is incompatible with Java Modules. If you run mvn dependency:tree you will see:

[INFO]    +- io.kubernetes:client-java-api:jar:21.0.1:compile
[INFO]    |  +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO]    |  +- jakarta.annotation:jakarta.annotation-api:jar:3.0.0:compile
[INFO]    |  +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
  1. The library depends on both javax.annotation and jakarta.annotation. I believe the latter is meant to replace the former.
  2. Both javax.annotation and jsr305 export the same package.

Anyone who tries declaring this library as a dependency will get this error:

module X reads package javax.annotation from both jsr305 and java.annotation

Client Version
21.0.1

Java Version
23

To Reproduce
Create an application that contains a module-info.java that contains the following lines:

requires io.kubernetes.client.java;
requires io.kubernetes.client.java.api;

Expected behavior
Ability to use from Java Modules. You'll need to replace all uses of javax.annotation by jakarta.annotation and ideally please find a replacement for JSR 305. See https://nipafx.dev/jsr-305-java-9/ for what a mess it is on Java 9+.

@cowwoc
Copy link
Author

cowwoc commented Oct 25, 2024

This issue is related to #2606

@brendandburns
Copy link
Contributor

Happy to take PRs to improve this.

@venkat1701
Copy link

Hey, I can take up this issue if it is still open, it seems more like a dependency update with minor refactors.
Thanks!

@cowwoc
Copy link
Author

cowwoc commented Jan 2, 2025

@venkat1701 Please do! The issue is still open.

@venkat1701
Copy link

/assign

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 2, 2025
@cowwoc
Copy link
Author

cowwoc commented Apr 7, 2025

@venkat1701 Any luck?

@venkat1701
Copy link

@cowwoc yeah, i've added exclusions for javax.annotation and 1. is solved. I am looking for solving the 2nd one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

5 participants