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 module-info.java #275

Closed
redcatbear opened this issue Nov 8, 2022 · 1 comment
Closed

Add module-info.java #275

redcatbear opened this issue Nov 8, 2022 · 1 comment

Comments

@redcatbear
Copy link

Is your feature request related to a problem? Please describe.
In Java 9 modules were introduced. They are an additional layer of encapsulation above packages.

Modules are a little bit of extra work for the developers, because they have to define which packages users of a library are allowed to see, which other modules a module depends on and so on. The result is a better-documented, more tightly encapsulated product, so it is worth the effort.

In the case of commonmark-java for example, this could be used to hide the internal API in org.commonmark.internal.

The main reason for this ticket is that projects with and projects without module information unfortunately don't mix well. As a developer using a module without explicit module info in your project, you are usually presented with error messages about missing exports.

Describe the solution you'd like
Please add module-info.java to your modules.

Describe alternatives you've considered
We checked the JAR file of the delivery and it has the auto-module set -- a fallback mechanism intended to mitigate problems when the actual module info is missing. Unfortunately this does not quite fix the issues. In our case for example the Java VM crashes in failsafe tests complaining about missing package exports.

We are able to use and build with commonmark in our project if we don't use a module-info.java in our own project, but we would like to add this. Especially since we are using it in a tutorial and would like new programmers to learn all aspects of writing a modern Java application.

Additional context
I wanted to say thank you for providing common-mark Java as Open Source software. It's a very useful library and the fact that this is Open Source helped us find the root cause of our troubles.

@redcatbear
Copy link
Author

And I just realized that I created a duplicate of #125. Sorry for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant