This problem looks like an edge-case of #382 . We are using ClassGraph 4.8.58, but the problem still exists with 4.8.65.
Basically, we are configuring ClassGraph with
ClassGraph().overrideClassLoaders(classloader)
.ignoreParentClassLoaders()
.enableClassInfo()
.scan()
The classloader parameter is usually expected to be an instance of URLClassLoader but in some circumstances it may be the application classloader, and Java 8 is fine with this. However, ClassGraph doesn't find anything inside the application classloader on Java 11! The fix from #382 does enable module scanning, but the "Module Finder" still doesn't find any modules to scan.
We are currently working around this using:
ClassGraph().apply {
if (classloader !== ClassLoader.getSystemClassLoader()) {
overrideClassLoaders(classloader)
}
}.ignoreParentClassLoaders()
.enableClassInfo()
.scan()
}
This problem looks like an edge-case of #382 . We are using ClassGraph 4.8.58, but the problem still exists with 4.8.65.
Basically, we are configuring ClassGraph with
ClassGraph().overrideClassLoaders(classloader) .ignoreParentClassLoaders() .enableClassInfo() .scan()The
classloaderparameter is usually expected to be an instance ofURLClassLoaderbut in some circumstances it may be the application classloader, and Java 8 is fine with this. However, ClassGraph doesn't find anything inside the application classloader on Java 11! The fix from #382 does enable module scanning, but the "Module Finder" still doesn't find any modules to scan.We are currently working around this using: