Automatic module update
An explicit module (that is, one with module-info.java ) can only access the module code that it requires (ignoring Automatic modules - this is the answer: Any JAR that ends in the path to the module turns into a module. If the JAR does not contain a module declaration, the module system creates an automatic module with the following properties:
- display name (this is an important bit here)
- reads all other modules
- export all packages
Maven relies on this mechanism, and after creating module-info.jar it puts all the dependencies in the module path.
Auto Names
There are two ways to display the name of an automatic module:
- manifest entry
- Suppose the JAR file name
In the first case, the name was intentionally chosen by the maintainer, so it can be considered stable (for example, it does not change when the project becomes modular). The second, obviously, is unstable throughout the ecosystem - not all project settings lead to the same filenames of their dependencies.
What does it mean?
The reason for the warnings is that some of your dependencies are automatic modules and do not determine their future module name in the manifest. Instead, their name comes from the file name, which makes them unstable
Stable names
So why are erratic names such problems? Suppose your library is published using requires guava , and my framework is published using requires com.google.guava . Now someone uses your library with my map, and they suddenly need the guava and com.google.guava modules on their way to the module. There is nothing a painless solution to this problem, so it must be prevented!
How? For example, discouraging developers from publishing artifacts that depend on automatic file-based modules. 😉
Nicolai
source share