private List<PotentialSchemaClass> getAllClassNames() {
        if (this.allTypes != null) {
            return this.allTypes;
        }
        ClassGraph classGraph = new ClassGraph()
                .overrideClasspath(classpath.getClasspathElements(this.project))
                .enableClassInfo();
        boolean considerAnnotations = this.annotations != null && !this.annotations.isEmpty();
        if (considerAnnotations) {
            classGraph.enableAnnotationInfo();
        }
        ClassInfoList.ClassInfoFilter filter = createClassInfoFilter(considerAnnotations);
        try (ScanResult scanResult = classGraph.scan()) {
            Stream<ClassInfo> allTypesStream;
            if (considerAnnotations) {
                allTypesStream = this.annotations.stream()
                        .flatMap(a -> scanResult.getClassesWithAnnotation(a.className).filter(filter).stream())
                        .distinct();
            } else {
                allTypesStream = scanResult.getAllClasses().filter(filter).stream();
            }
            this.allTypes = allTypesStream
                    .map(PotentialSchemaClass::new)
                    .collect(Collectors.toList());
        }
        return this.allTypes;
    }
Get all the names of classes on the classpath.

@return A set of classes as found on the classpath, that are not explicitly excluded
jsonschema-maven-plugin/src/main/java/com/github/victools/jsonschema/plugin/maven/SchemaGeneratorMojo.java