diff --git a/spring-bootstrap/src/main/java/org/springframework/bootstrap/context/annotation/ConfigurationPropertiesBindingConfiguration.java b/spring-bootstrap/src/main/java/org/springframework/bootstrap/context/annotation/ConfigurationPropertiesBindingConfiguration.java index f458014aab..d98c0541f0 100644 --- a/spring-bootstrap/src/main/java/org/springframework/bootstrap/context/annotation/ConfigurationPropertiesBindingConfiguration.java +++ b/spring-bootstrap/src/main/java/org/springframework/bootstrap/context/annotation/ConfigurationPropertiesBindingConfiguration.java @@ -56,11 +56,15 @@ public class ConfigurationPropertiesBindingConfiguration { @Qualifier(VALIDATOR_BEAN_NAME) private Validator validator; - @Bean @ConditionalOnMissingBean(name = VALIDATOR_BEAN_NAME) @ConditionalOnClass(name = "javax.validation.Validator") - protected Validator configurationPropertiesValidator() { - return new LocalValidatorFactoryBean(); + public static class ValidatorConfiguration { + + @Bean + protected Validator configurationPropertiesValidator() { + return new LocalValidatorFactoryBean(); + } + } /**