I have a spring @configuration annotated class MappingsClientConfig with a boolean field as:
@Value(\"${mappings.enabled:true}\")
private boolean mappi
Looks like you're missing the PropertyPlaceholderConfigurer. You need to register it as a bean factory post processor. Theoretically this could be done like this:
public class PostProcessorConfig {
@Bean
public BeanFactoryPostProcessor getPP() {
PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
configurer.setLocations(new Resource[]{new ClassPathResource("/my.properties")});
return configurer;
}
}
However, there seems to be a bug that causes other issues doing this from a java based configuration. See ticket for workarounds.