spring.profiles.active=dev : or =prod can be used with command line with deploying. @Profile("dev"): this annotation can be used over bean to instantiate for a particular profile only or to make different bean for different profiles.