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 {
@Override
public PropertySource<?> createPropertySource(String name, EncodedResource encodedResource) {
YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean();
factory.setResources(encodedResource.getResource());
Properties properties = factory.getObject();
return new PropertiesPropertySource(encodedResource.getResource().getFilename(), properties);
}
}
CLICK HERE to find out more related problems solutions.