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 explicit module-info #4990

Open
bowbahdoe opened this issue Apr 30, 2024 · 3 comments
Open

Add explicit module-info #4990

bowbahdoe opened this issue Apr 30, 2024 · 3 comments
Labels
blocked An issue that's blocked on an external project change

Comments

@bowbahdoe
Copy link

Please describe the feature request.

This is a follow up to #1242 which gave a stable module name. The next step is to add an actual module descriptor.

Rationale

To be able to use jlink, everything on your dependency tree needs to be an explicit module.

This is the graph of what spring-web brings in. Red is no module info, Yellow is automatic module info, Green is full module descriptor. I am working through all the artifacts which are not maintained by Spring to see what I can do.

image

Additional context

There are 3 broad ways to do this.

  1. Bump the entire project to a higher Java version. Add a module-info.java, update build plugins, etc.
  2. Set up multi-release jars with a folder for "java 9" code where we put a module-info and configure the build
  3. Use the moditect plugin to generate a module info

The first is the best but has an obvious cost to it. The second and third I am used to setting up on Maven for folks. Nowhere near as comfortable with Gradle.

@shakuzen
Copy link
Member

shakuzen commented May 1, 2024

Bump the entire project to a higher Java version.

This isn't possible without a new major version. I don't foresee that happening anytime soon.

Isn't a prerequisite of adding an explicit module-info.java that all dependencies we declare have at least an automatic module name? In micrometer-core, I see our dependencies don't:
image
We will have the same issue with some of the registry modules that have external dependencies.

@bowbahdoe
Copy link
Author

bowbahdoe commented May 1, 2024

This isn't possible without a new major version. I don't foresee that happening anytime soon.

Ways 2 or 3 it is.

Isn't a prerequisite of adding an explicit module-info.java that all dependencies we declare have at least an automatic module name? In micrometer-core, I see our dependencies don't:

Okey dokie. Further into the mines I go.

I opened a PR on HDR histogram. Its last release was 4 years ago and they do have an automatic module name in their POM so maybe there just hasn't been a release since that.

After that, LatencyUtils (since it depends on HdrHistogram) https://github.com/LatencyUtils/LatencyUtils

A non-trivial part will be having those folks make maven central releases too.

We will have the same issue with some of the registry modules that have external dependencies.

One thing at a time I guess.

@shakuzen shakuzen added blocked An issue that's blocked on an external project change and removed waiting-for-triage labels May 2, 2024
@giltene
Copy link

giltene commented May 5, 2024

@bowbahdoe HdrHistogram 2.2.1 is now released to maven central with your PR integrated. I can also do the same to LatencyUtils if you open a PR there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked An issue that's blocked on an external project change
Projects
None yet
Development

No branches or pull requests

3 participants