Springboot @ConfigurationProperties Not Injecting [duplicate]

Added a PropertySourceFactory and this fixed the issue.

@PropertySource Change

@PropertySource(value = "classpath:export-fields.yml", factory = YamlPropertySourceFactory.class)

YML Factory

public class YamlPropertySourceFactory implements PropertySourceFactory {

public PropertySource<?> createPropertySource(String name, EncodedResource encodedResource) {
    YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean();

Properties properties = factory.getObject();

return new PropertiesPropertySource(encodedResource.getResource().getFilename(), properties);



CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top