I use Spring Boot. Tell me how to "tell" the application to run in "dev" or "prodaction" mode. There is a reason to go so far - in dev you need to omit the user authorization process. I assume that you need some external configuration file, runtime parameter, or maybe there is something specific for Spring Boot? Tell me the best option and can eat where to peep the solution.
- docs.spring.io/spring-boot/docs/current/reference/html/… - Slava Semushin
- Thanks for the link, but it remains clear how to use different configuration files, but how to change the behavior of classes depending on the environment? - Alexander Dermenzhi
|
1 answer
As noted here , you can activate configurations depending on the active profile through the @Profile annotation.
Excerpt from JavaDoc:
If you’re online, you’ll be active.
Accordingly, you need to specify the profile in this annotation and initialize the bins in a profile-specific way.
|