I have a spring boot application that I can package in a war that I want to deploy to different environments. To automate this deployment it\'d be easier to have the configu
Yes, you need to use @PropertySource as shown below.
The important point here is that you need to provide the application_home property (or choose any other name) as OS environment variable or System property or you can pass as a command line argument while launching Spring boot. This property tells where the configuration file (.properties or .yaml) is exactly located (example: /usr/local/my_project/ etc..)
@Configuration
@PropertySource("file:${application_home}config.properties")//or specify yaml file
@ComponentScan({"be.ugent.lca","be.ugent.sherpa.configuration"})
@EnableAutoConfiguration
@EnableSpringDataWebSupport
public class Application extends SpringBootServletInitializer{
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}