Scan results empty in JPMS jlink'd distribution
See original GitHub issueI have this Main.java:
package test1;
import io.github.classgraph.ClassGraph;
public class Main {
public static void main(String[]args){
System.out.format("found: %s\n",
new ClassGraph().enableClassInfo().whitelistPackages("test1").scan().getAllClasses());
}
}
and also in test1
: FindMe1.java:
package test1;
public class FindMe1 {
}
Running this normally finds both classes:
$ /usr/lib/jvm/java-11-openjdk/bin/java -p dependency -m test1/test1.Main
found: [public class test1.FindMe1, public class test1.Main]
Running this from a jlinked distribution (used moditect to generate):
$ ./jlink-image/bin/java -p modules -m test1/test1.Main
found: []
Currently looking for a workaround.
Issue Analytics
- State:
- Created 5 years ago
- Comments:25 (11 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, FWIW
.enableSystemJarsAndModules()
does show all classes in this situation (regardless of order).I suppose that’s obvious, I was a bit confused though - I thought I had
.enableAllInfo()
on (which wasn’t the case) and I thoughtenableAllInfo
would include the SystemJars.So I’m good for now since there’s that workaround.
Released in 4.8.0.
https://github.com/classgraph/classgraph/releases/tag/classgraph-4.8.0
Thanks for the bug report!