-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 Automatic-Module-Name to package #431
Comments
Can you provide more information? I'm not sure what you are talking about. |
When using on JDK 9 or above, the module name is automated to the filename "json". Using a proper module-name needs to happen :)
This can be solved properly by adding the following line into the Manifest.MF file There are two possible ways for an automatic module to get its name: |
Thanks, I'll take a look, but at a brief glance, this will probably affect our package maintainer @BGehrels |
@BGehrels the Adding in module-info.java really isn't useful at this time since older compilers won't know what to do with a |
There are a few ways to do this, I recommended what I thought would be the best approach with least impact, To build the module-info and not change anything and only update your project - the moditect (https://github.com/moditect/moditect) project does precisely this compatible with jdk 7 I believe. Used in quite a few places successfully (look at classgraph) Other ways include
I do recommend moditect without changing the codebase if you do want a module-info.java class file in a jre7/8 library. |
We are currently compiling to jdk6 to leave support for some older embedded systems that don't allow updates to the JVM. Using the gradle/maven support to modify the manifest seems like the easiest solution at the moment to me. Adding in extra dependencies just for building is usually a bad idea for such simple projects as this. We have only a single module package to export, and we have no external dependencies, so updating the MANIFEST.MF to contain |
100% 👍 |
Ready when you are, pom changes are implemented, all i'll need is a git tag here and in the test repo (with identical names) |
@BGehrels 20180813 is ready in both repos, thanks! |
Doesn't look like it's synced to central :) |
just built the release, should be synced to cenetral in the next hour |
hmm, taking forever to sync |
Oops, yes, forgot to press one magic button, should work soon |
Hmm, nope |
yeah just maven central web sites not updated, 100% |
THANKSSSS!!!!! much love |
I would suggest you look at the class versioning system introduced in Java 9(META-INF/versions/9) to add the module-info.java file because it actually does serve a purpose. Notably jlink won't be able to create images with this library because it can't use automatic modules even if they have a fixed name. This is unfortunately a problem I'm running into and the only fix is for me to recompile the sources from git with my own module-info.java file |
@A-Ghost do you have a quick how-to or other document you can link to with an overview of the feature? When I looked, I didn't see a nice way to include a module-info.java file and still have it compile down to java6. Or better yet, can you offer a pull request that would accomplish this? Java6 is still a requirement for this project at this time. |
Getting warnings when deploying to central that there are filename based references (requires json) :)
Please make a module name :)
The text was updated successfully, but these errors were encountered: