-
Notifications
You must be signed in to change notification settings - Fork 54
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
Document how to generate module files using moditect #61
Comments
Hmmh. That would be nice... I learned it by trial and error, but not sure I ever figured out a reliable mechanism even. Moditect plug-in has (at least) 2 targets; one that is enabled (use existing module-info.java, bake it in) is easy, but one used for first-time generation is trickier.
So. I think it's something like
but for some reason this requires that version has already been locally installed ( I'll check if I can make this work from home: and if so, it'd be great if you could double-check it, before I write it down. What I do remember is that Moditect plug-in is quite finicky, unfortunately. |
A few findings:
When generating module-infos in jackson-datatypes-collections.
Because otherwise, there is a chicken-and-egg problem with
|
Another issue is that generated module-info doesn't look quite right to me (at least, it differs from module-infos generated previously), e. g. it has |
@GedMarc any idea why that recently added @leventov Oh, one other thing: ideally we would get module-info in |
@cowtowncoder java.base is kind of the root of the entire module structure, so shouldn't really be placed anywhere ever. Should maybe raise that as an actual issue on moditect, I know @lukehutch worked on it for a bit? I think perhaps he would know better on this. Any alterations to this module is forcibly done on the command line --add-opens etc - even in jlink/jpackage artefacts In terms of requires transitive (forcing the module dependency down the module chain breaking clean separation), from what I remember, this is done whenever a class of a dependent module is exposed in a public api method. In these cases the dependency must be transitive. (Also why I never auto generate the module-info's, I've come to always code from bottom up adding only what is referenced. that method limit of 64k is extremely painful and libraries adding to that complexity size for me now is a bit erggg) |
@GedMarc ok I am asking because you suggested that it should be added in FasterXML/jackson-databind#2485 which seemed odd but (I thought) harmless. I can easily remove it, just want to make sure it should NOT be there, even if Moditect plug-in might suggest it (which I assume is where it came from) And yes, I think as a rule of thumb if API exposes a type, that type should be transitive dependency. |
omg oo sorry! covers face |
You can see how ClassGraph uses ModiTect here: https://github.com/classgraph/classgraph/blob/master/pom.xml The reason for this usage was to build for JDK 7, but allow for proper Although fair warning, even putting I don't think you ever need to add |
Will be interesting to see what kinds of issues users bump into with 2.10.0. I am hoping devs running on very old containers would use older Jackson versions, but one challenge is that due to CVEs reported there has been surprisingly strong push to newer versions. But so far I haven't really heard of issues with odd I did remove that base reference so it won't be in 2.10.1, fwtw. |
@cowtowncoder could you please also remove |
Done. Odd that merge didn't do it... |
Working on this PR: #51, I'm having trouble generating module-info.java for the new module (
primitive-collections-base
). It would be nice if this repository contained some dev documentation about how to initially generate & update module-infos for new and existing modules in this project.The text was updated successfully, but these errors were encountered: