Answer the question
In order to leave comments, you need to log in
How to understand Spring profiles?
Hello!
Quite a strange situation with profiles in Spring Boot. Checked in versions 2.0.6 and 2.1.0
It is possible that I misunderstood the principle of how profiles work... I built
a project on Spring Boot ( https://start.spring.io/) via intelllij IDEA Ultimate Edition + using Gradle.
Created 3 .properties files
application.properties
application-dev.properties
application-production.properties
spring.profiles.active=dev
Answer the question
In order to leave comments, you need to log in
Thanks to the help, I finally figured out the problem and it was terribly banal)))
In general, when creating a properties file, you must manually add .properties, if you select the properties file type in the IDE, it will simply create a file (not in the properties format.)
Solution link:
Why does Spring ignore profile file properties configurations?
Screen:
Where are these files? They must be either in the class path or in the working directory (for IDEA, this is the default project root).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question