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

[MRESOLVER-27] Turn resolver api, spi and utils into Java 9 modules with generated module-info.class #516

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

HannesWell
Copy link
Contributor

This PR has the same intend as #508, but uses the bnd-maven-plugin to generate the module-info.class automatically using the -jpms-module-info instruction:
https://bnd.bndtools.org/releases/6.4.0/chapters/330-jpms.html

The differences to #508 are that the source module-info.java is not generated and that the module-info.class is always placed in the jar root. But since JRE's below Java-9 don't recognize that file, I hope that's not a problem.

@HannesWell
Copy link
Contributor Author

Btw. this is intentionally split into two commits, where the first one only changes the configuration to define all MANIFEST.MF entries through the bnd-maven-plugin.

@rfscholte
Copy link
Contributor

But since JRE's below Java-9 don't recognize that file, I hope that's not a problem.

That's not a problem. This spec is making use of the fact that - is not allowed in a className, so these files will be ignored.

@rfscholte
Copy link
Contributor

@HannesWell I guess by default all packages are exported, right? For these 3 that's fine, for all others we need to verify every package if it should be exported.
I've checked a couple of jars, results look as expected.

@HannesWell
Copy link
Contributor Author

@HannesWell I guess by default all packages are exported, right? For these 3 that's fine, for all others we need to verify every package if it should be exported. I've checked a couple of jars, results look as expected.

Thanks for checking/reviewing.
That's right, but with using this approach the JPMS module-info and the OSGi metadata in the MANIFEST.MF export the same packages. So for each module the exported packages can be configured by adjusting the configuration of the bnd-maven-plugin.

FYI this is currently based on (an older state of) #517, which should probably be submitted after #513. Then this is basically a three-line change.

@HannesWell HannesWell marked this pull request as ready for review June 25, 2024 20:34
@HannesWell
Copy link
Contributor Author

Now that #517 is submitted, all prerequisites for this from my POV are done.

@rfscholte rfscholte merged commit 8266e6c into apache:master Jun 27, 2024
5 checks passed
@HannesWell HannesWell deleted the maven-resolver-27 branch June 27, 2024 10:34
@gnodet gnodet added this to the 2.0.0 milestone Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants