Solution: Add the --add-modules my.module flag. Question: is it a dependency added to the root dependency, or is it added as root?
A module added using the --add-modules flag is added to the default set of root modules and the module schedule and is allowed at runtime to run, because the dependency on the module was optional at compile time.
Is it possible to have a direct requirement to avoid using additional flag modules?
Yes, you can have direct requires also for such dependencies and make sure that the module added to the module schedule is not optional, but it is a design issue when you consider optional and optional dependencies for your project.
requires static basically provides a means for determining a module dependency, which is mandatory at compile time, but optional at run time, for use with libraries that are not strictly necessary, but can be involved if they are present at run time.
source share