Skip to content

Commit 806214e

Browse files
committed
DATACMNS-591 - RepositoryConfigurationDelegate now uses Environment and ResourceLoader everywhere.
We now also use the Environment and ResourceLoader for the component scan to detect whether multiple Spring Data modules are on the classpath.
1 parent e14ba80 commit 806214e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/org/springframework/data/repository/config/RepositoryConfigurationDelegate.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,13 @@ public List<BeanComponentDefinition> registerRepositoriesIn(BeanDefinitionRegist
159159
*/
160160
private boolean multipleStoresDetected() {
161161

162-
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false,
163-
environment);
162+
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
163+
scanner.setEnvironment(environment);
164+
scanner.setResourceLoader(resourceLoader);
164165
scanner.addIncludeFilter(new LenientAssignableTypeFilter(RepositoryFactorySupport.class));
165-
int numberOfModulesFound = scanner.findCandidateComponents(MODULE_DETECTION_PACKAGE).size();
166166

167-
if (numberOfModulesFound > 1) {
167+
if (scanner.findCandidateComponents(MODULE_DETECTION_PACKAGE).size() > 1) {
168+
168169
LOGGER.debug(MULTIPLE_MODULES);
169170
return true;
170171
}

0 commit comments

Comments
 (0)