Skip to content

Commit

Permalink
Migrate org.reflections.reflections from 0.9.12 to 0.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
RiVogel committed Nov 6, 2023
1 parent bd2afee commit 570ef8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import com.senacor.elasticsearch.evolution.core.api.MigrationException;
import com.senacor.elasticsearch.evolution.core.api.migration.MigrationScriptReader;
import com.senacor.elasticsearch.evolution.core.internal.model.migration.RawMigrationScript;
import java.util.regex.Pattern;
import org.reflections.Reflections;
import org.reflections.scanners.ResourcesScanner;
import org.reflections.scanners.Scanners;
import org.reflections.util.ClasspathHelper;
import org.reflections.util.ConfigurationBuilder;
import org.reflections.util.FilterBuilder;
Expand Down Expand Up @@ -147,10 +148,13 @@ private Stream<RawMigrationScript> readScriptsFromClassPath(String location) {
resources = emptySet();
} else {
Reflections reflections = new Reflections(new ConfigurationBuilder()
.setScanners(new ResourcesScanner())
.setScanners(Scanners.Resources)
.filterInputsBy(new FilterBuilder().includePackage(locationWithoutPrefixAsPackageNotation))
.setUrls(urls));
resources = reflections.getResources(this::isValidFilename);
resources = reflections.getResources(Pattern.compile(esMigrationPrefix + ".*"))
.stream().map(path -> Paths.get(path).getFileName().toString())
.filter(this::isValidFilename)
.collect(Collectors.toSet());
}

return resources.stream().flatMap(resource -> {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<commons-io.version>2.15.0</commons-io.version>
<!--when updating elasticsearch versions, also update "ElasticsearchContainer" version in EmbeddedElasticsearchExtension-->
<elasticsearch.version>7.5.2</elasticsearch.version>
<reflections.version>0.9.12</reflections.version>
<reflections.version>0.10.2</reflections.version>
<testcontainers.elasticsearch.version>1.19.1</testcontainers.elasticsearch.version>
<lombok.version>1.18.30</lombok.version>
</properties>
Expand Down

0 comments on commit 570ef8b

Please sign in to comment.