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

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

Open
cowwoc opened this issue Oct 25, 2024 · 2 comments
Open

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

cowwoc opened this issue Oct 25, 2024 · 2 comments

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.

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