Add module-info.java
It would be useful to have a module-info.java added. Is there a reason this file is not present yet?
If there is no specific reason, I’m willing to add one. This library is preventing me from creating a build with jlink now.
Is the class org.yaml.snakeyaml.Yaml the only required public API? (It is the only one I’m using, but my use-case is fairly simple)
Comments (15)
-
-
reporter Aha, I wasn’t aware of that. If your plan is to keep this library on Java 7, then things should be left as they are now. The MANIFEST.MF file already contains a module name (org.snake.yaml) which makes it perfectly usable in most cases in java 9+.
Alternatively the source and target level could be updated to version 9 and a module-info should be added to export only the public API. In my local build this works perfectly as far as I can tell. If you’re willing to go this path, I can create a PR.
-
We must keep Java 7. A lot of projects which use SnakeYAML are still under Java 7.
-
reporter - changed status to wontfix
Since this library must remain compatible with Java 7, this request is pointless.
-
It is absolutely possible to add module-info and still be compatible with Java 7
The trick is to compile all classes to java 7 bytecode and only module-info to java 9
It works ok with android, too
If you are ok with this approach, please reopen the issue, I will provide a pull request
-
Don’t we need to use Java 9 to build it ?
-
To build it - yes, to use it - no
-
Dear Василий, are you ready to jump into all the issues which may occur because of this change ? Spring Boot, Jackson, RAML and all the other projects which already use SnakeYAML. Do you confirm a commitment to explain and resolve any question which may happen because of the build process ? (the misunderstanding will happen, the JDK is not perfect)
-
Andrey, I think, I am.
I do not expect any problems (based on experience), but I up ready to investigate any issues and help with clarifications if required
-
- changed status to open
-
waiting for the PR
-
- changed status to resolved
it will be delivered in version 2.0
-
while we wait for
2.0
to be released, it’s also possible to add amodule-info.class
using ModiTect and keep the JAR compatible with Java 8 or 7.If Interested I can send a PR.
-
2.0 will most probably be released this month (2023-02)
-
Lovely! Then there’s nothing else to be done than patiently wait for the release. Thank you!
- Log in to comment
Contributions are welcome.
Please be aware the SnakeYAML is Java 7