samedi 25 février 2023

Google Guava getTopLevelClassesRecursive not finding classes when running, only during test

I am using OpenJDK 17 and Guava 31.1-Jre. I am also using Spring Boot.

I have the line:

ImmutableSet<ClassPath.ClassInfo> classSet = ClassPath.from(ClassLoader.getSystemClassLoader())
                    .getTopLevelClassesRecursive(config.getFunctionPackage());

Whenever i run "mvn test", it finds the appropriate classes. But when i run it using "java -jar ...", it does not find a any classes. And i verified that "config.getFunctionPackage()" returns the same value both times.

Is a different class loader being used, or is something else going on?

thank you.





Aucun commentaire:

Enregistrer un commentaire