github classgraph/classgraph fast-classpath-scanner-2.20.1

latest releases: classgraph-4.8.172, classgraph-4.8.171, classgraph-4.8.170...
5 years ago

Added FastClasspathScanner#filterClasspathElements(String -> boolean), which allows you to skip elements in the classpath, depending on whether or not their path meets a given criterion. For example:

    ScanResult result = new FastClasspathScanner(pkgName)
        .filterClasspathElements(path -> !path.contains("/BOOT-INF/lib"))
        .scan();

Note: Scanning anything other than the complete classpath can result in classloading quirks, in particular where the same class is defined twice, differently, on the classpath (since FCS might give you info about the second definition of the class on the classpath, if you skip the classpath element containing the first definition, but the context classloader may have already loaded and cached the first definition of the class).

Thanks to @mgardiner and @NogginBops for the suggestion.

Don't miss a new classgraph release

NewReleases is sending notifications on new releases.