in my target folder, there are 2 folders, lib and conf. all the properties files are placed in conf folder, and jars are placed in lib foulder.
previous to spring boot, we use following configuration in spring.xml to use @value
<context:property-placeholder location="classpath*:*.properties"/>
and in java code like:
@Value("${name}")
private String name;
but in spring boot, i don't know how to do the same in java code.
i have tried following, but not work
@Configuration
@PropertySource(value = "classpath:aaa.properties")
public class AppConfig {
@Bean
public PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
return new PropertySourcesPlaceholderConfigurer();
}
}