I work for the first time with the Spring Framework, and faced with the fact that I can not add my sources of property. The following code:
@Bean public static YamlPropertiesFactoryBean yamlProperties() { YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean(); factory.setResources(new ClassPathResource("application.yml")); return factory; } @Bean public static PropertyPlaceholderConfigurer propertyPlaceholder() { PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer(); configurer.setProperties(yamlProperties().getObject()); return configurer; } It works correctly, I can drop an arbitrary property to the logger, the methods themselves are executed, but in the environment these properties are not added (ie, environment.getProperty() does not return to me the value that I can get through yamlProperties.getObject().getProperty() ) WHERE and how do I add my configuration to the application?