From f53b63844103a89fc12cec437b91f5187ba4e974 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 26 Aug 2018 20:18:35 +0100 Subject: [PATCH] Replace fast-classpath-scanner with classgraph --- builder/pom.xml | 8 ++++---- .../checkstyle/ruleset/builder/DefaultPackageScanner.java | 8 +++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/builder/pom.xml b/builder/pom.xml index d529718..9342c8a 100644 --- a/builder/pom.xml +++ b/builder/pom.xml @@ -32,7 +32,7 @@ 2.21.0 3.11.0 0.6.0 - 3.1.15 + 4.1.2 3.0.0 ${project.version} @@ -66,9 +66,9 @@ ${conditional.version} - io.github.lukehutch - fast-classpath-scanner - ${fast-classpath-scanner.version} + io.github.classgraph + classgraph + ${classgraph.version} org.mockito diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultPackageScanner.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultPackageScanner.java index f193f1b..232b08e 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultPackageScanner.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultPackageScanner.java @@ -21,7 +21,7 @@ package net.kemitix.checkstyle.ruleset.builder; -import io.github.lukehutch.fastclasspathscanner.FastClasspathScanner; +import io.github.classgraph.ClassGraph; import org.springframework.stereotype.Service; import java.util.List; @@ -38,9 +38,11 @@ public class DefaultPackageScanner implements PackageScanner { @Override public final List apply(final RuleSource ruleSource) { final String basePackage = ruleSource.getBasePackage(); - return new FastClasspathScanner(basePackage) + return new ClassGraph() + .whitelistPackages(basePackage) .scan() - .getNamesOfAllStandardClasses() + .getAllStandardClasses() + .getNames() .stream() .filter(packageName -> packageName.startsWith(basePackage)) .collect(Collectors.toList());