This message was deleted.
# dependency-management
s
This message was deleted.
t
AFAIK, Gradle uses a "simple" URLClassLoader, so no modules (and Gradle starts itself with a classpath, not module path, in case that matters).
j
That’s correct. You can’t load Jars as Modules in Gradle plugins. So even if Nashorn is a JPMS module, the module information is ignored. But I think it should also work in that environment. ServiceLoader existed before JPMS already and can be used also in a classpath environment (but I am no expert on that topic).
t
But AFAIK ServiceLoader only takes into account META-INF/services in a classpath environment, not module-info, and Nashorn only provides the module-info definition of the service.
👍 2
b
OK, so this means probably the URLClassLoader respects the module-info definition in a JDK9+ environment to handle the ServiceLoader correctly. Will check how this is implemented in Spotless.
Spotless uses a custom class loader derived from URLClassLoader to load the formatting features.