Add check for non empty list of factories
It was seeen that if a different plugin was used to package Spring Boot that the project would load but no autoconfiguration actually took place and many features were mysteriously not working. Adding a check to ensure that some factories are always loaded as this is expected. Closes gh-5465
This commit is contained in:
parent
1b8f44ae2a
commit
971a7194d8
|
|
@ -140,8 +140,11 @@ public class EnableAutoConfigurationImportSelector
|
||||||
*/
|
*/
|
||||||
protected List<String> getCandidateConfigurations(AnnotationMetadata metadata,
|
protected List<String> getCandidateConfigurations(AnnotationMetadata metadata,
|
||||||
AnnotationAttributes attributes) {
|
AnnotationAttributes attributes) {
|
||||||
return SpringFactoriesLoader.loadFactoryNames(
|
List<String> configurations = SpringFactoriesLoader.loadFactoryNames(
|
||||||
getSpringFactoriesLoaderFactoryClass(), getBeanClassLoader());
|
getSpringFactoriesLoaderFactoryClass(), getBeanClassLoader());
|
||||||
|
Assert.notEmpty(configurations,
|
||||||
|
"No auto configuration factories available. Please check your packaging to assure that the META-INF/spring.factories file is correct.");
|
||||||
|
return configurations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue