Let's say I want to publish a library like Apache Math to Maven Central.
It should expose capabilities in packages that are explicitly exported by either OSGI or JPMS. That way, consuming applications can access those packages.
Any packages not explicitly exported are unavailable in consuming applications. They are able to download the JAR via a Maven dependency declaration, but are unable to see any packages, as the manifest and module-info.class are both empty. OSGI is able to automatically and robustly resolve the package-level dependency tree and generate meaningful entries in the manifest. There is no tool that robustly does the same for module-info, guidance I can find in other forums is to use jdeps with the stated caveat that it is not robust and the resulting module-info.java needs to be further adjusted manually.
Unless there is something fundamental that I am misunderstanding about the Java compilation system, Java ignores all class files in a jar file unless they are identified as "exported" by either the module system (JPMS) or OSGI, or the class files are explicitly included by some other mechanism.
What are the steps to configuring and publishing such a library such that relevant packages are exported, and why is there no step-by-step guide to do this already?