JPMS appeared in Java 9, now Java 14 is available. Starting from Java 9 we have two types of path:
# – class-path # --module-path.
If JPMS is used in application then, as a rule, no class-path is used.
So I suggest to add scanning for persistence.xml also in module-path if Java9+. Although according to JPA specs persistence.xml file has to be located in the META-INF directory in the classpath, all we know that there was no JPMS when JPA specs was written.
At the same time module-path scanning must be enabled only explicitly for example via java system property.
At the same time JPMS layers can be created dynamically and there can be added other modules that are not on --module-path.
|
|