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

Module based library ( support for Java 9+ ) #1996

Open
ankeetj opened this issue Feb 11, 2020 · 8 comments
Open

Module based library ( support for Java 9+ ) #1996

ankeetj opened this issue Feb 11, 2020 · 8 comments

Comments

@ankeetj
Copy link

ankeetj commented Feb 11, 2020

I'm using Java 11 and trying to create a lightweight JRE . Is there a new version for kubernetes-client which uses modules ? It will make uptake very easy in java 9 + .

@rohanKanojia
Copy link
Member

@ankeetj : Our client has been compatible with JDK 11 since v4.1.2

@ankeetj
Copy link
Author

ankeetj commented Feb 11, 2020

@ankeetj : Our client has been compatible with JDK 11 since v4.1.2

I'm using 4.6.4 version of kubernetes-client and there is no module-info.class there.

rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Mar 5, 2020
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Mar 5, 2020
@rohanKanojia rohanKanojia self-assigned this Mar 6, 2020
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Mar 6, 2020
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Apr 3, 2020
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Apr 4, 2020
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Apr 4, 2020
@manusa manusa self-assigned this Apr 8, 2020
@dpratt
Copy link

dpratt commented May 5, 2020

A quick workaround for this would be to add an Automatic-Module-Name directive to the MANIFEST.MF file in your published jars. It doesn't require any other Java 9 specifics, nor does your code have to behave like a module. However, it does provide a stable module name for anybody that does want to use your client in a modular application. Without it, a modular application importing your library on the modulepath gets a name generated from the filename of the jar, which is obviously not a good thing. To do this, you need to do two things

  • Pick unique module names for each of your artifacts. It's worthwhile spending a little time (but not much) on this, as if you ever do move to a truly modular jar, you're going to want to keep the same name.
  • Add bits to the build to add an Automatic-Module-Name entry to each jarfile produced by your build - you can see more info on that here

@stale
Copy link

stale bot commented Aug 6, 2020

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

@stale stale bot added the status/stale label Aug 6, 2020
@stale stale bot closed this as completed Aug 13, 2020
@fransguelinckx
Copy link

Are there any short or long term plans on adding support for java modules?

@rohanKanojia
Copy link
Member

Actually, we tried moving to java modules but it seemed quite painful as it required some of the dependencies (like sundrio for builder generation) to move to modules too. Are you blocked due to this issue?

@fransguelinckx
Copy link

We have a workaround where we re-package the kubernetes-client packages in 1 jar, so certainly no blocker.

@manusa
Copy link
Member

manusa commented Oct 18, 2022

Now that #4464 / #4460 has been tackled, we should be able to complete this issue.

#2110 should now be closed or recreated from scratch (@rohanKanojia).

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