diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java index a5cf9197d..7d5edf372 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java @@ -699,7 +699,11 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon packagesToScan.add(domainType.getPackage().getName()); } - return new AnnotatedTypeScanner(Projection.class).findTypes(packagesToScan); + AnnotatedTypeScanner scanner = new AnnotatedTypeScanner(Projection.class); + scanner.setEnvironment(applicationContext.getEnvironment()); + scanner.setResourceLoader(applicationContext); + + return scanner.findTypes(packagesToScan); } //