diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 87b6673a63..ff19e5a179 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -91,7 +91,7 @@ 0.9.1 1.2 4.11 - 3.2.2 + 3.0.8 1.2.17 2.0.2 1.1.2 diff --git a/spring-boot/src/main/java/org/springframework/boot/liquibase/SpringPackageScanClassResolver.java b/spring-boot/src/main/java/org/springframework/boot/liquibase/SpringPackageScanClassResolver.java index 6427015554..46e99a037a 100644 --- a/spring-boot/src/main/java/org/springframework/boot/liquibase/SpringPackageScanClassResolver.java +++ b/spring-boot/src/main/java/org/springframework/boot/liquibase/SpringPackageScanClassResolver.java @@ -47,20 +47,25 @@ public class SpringPackageScanClassResolver extends DefaultPackageScanClassResol this.logger = logger; } - @Override - protected void findAllClasses(String packageName, ClassLoader loader) { - MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory( - loader); - try { - Resource[] resources = scan(loader, packageName); - for (Resource resource : resources) { - addFoundClass(loadClass(loader, metadataReaderFactory, resource)); - } - } - catch (IOException ex) { - throw new IllegalStateException(ex); - } - } + @Override + protected void find(PackageScanFilter test, String packageName, ClassLoader loader, + Set> classes) { + MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory( + loader); + try { + Resource[] resources = scan(loader, packageName); + for (Resource resource : resources) { + Class candidate = loadClass(loader, metadataReaderFactory, resource); + if (candidate != null && test.matches(candidate)) { + classes.add(candidate); + } + } + } + catch (IOException ex) { + throw new IllegalStateException(ex); + } + } + private Resource[] scan(ClassLoader loader, String packageName) throws IOException { ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(loader); String pattern = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX