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

Add module-info / JPMS support #114

Open
miasma opened this issue Nov 23, 2024 · 0 comments
Open

Add module-info / JPMS support #114

miasma opened this issue Nov 23, 2024 · 0 comments

Comments

@miasma
Copy link

miasma commented Nov 23, 2024

Description

As you might know, the pre-9 versions of Java are running out of support quiet soon. Oracle provides extended support for JDK 8 until the end of 2030 according to https://www.oracle.com/java/technologies/java-se-support-roadmap.html. Many distributions have already switched to Java 17 as a default and a jump to Java 21 will be expected in less than 2 years.

Later versions support project jigsaw modules / JPMS. Many libraries have already added support. For instance, Apache commons libraries provide module-info, JavaEWAH which is one of jgit's dependencies provides module-info. Consider adding support for module-info, at least for org.eclipse.jgit core.

The only challenge here is to think which packages would be exposed as part of the public API.

I've included an example here: module-info.txt
This exposes all the packages, which might not be optimal.
You'll also need a way to write the module-info. If it's not included in the src/ folder, you can use something like this: https://github.com/lemire/javaewah/blob/master/pom.xml#L135

Motivation

If done properly, adding module-info would not break any existing use cases (see the example I linked). Including module-info.class in the jar means Java 9+ projects can easily use the library with jlink and without need for workarounds. Automatic modules won't solve the issue with jlink.

Alternatives considered

  1. Moditect
  2. Forking the project

Additional context

No response

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

1 participant