We Are Going To Discuss About spring.profiles.active is not working in springboot application. So lets Start this Java Article.
spring.profiles.active is not working in springboot application
- spring.profiles.active is not working in springboot application
To activate a profile via annotations you need
@ActiveProfile("profileName")
. The@Profile
annotation is used to label an object as being a member of the profile. - spring.profiles.active is not working in springboot application
To activate a profile via annotations you need
@ActiveProfile("profileName")
. The@Profile
annotation is used to label an object as being a member of the profile.
Solution 1
To activate a profile via annotations you need @ActiveProfile("profileName")
. The @Profile
annotation is used to label an object as being a member of the profile.
Original Author Of This Content
Solution 2
you can also try to run the application and pass them as command line args
java -jar -Dspring.profiles.active={your_profile_name} application.jar
or if you run the app via maven:
mvn spring-boot:run -Dspring-boot.run.profiles={your_profile_name}
Here is an nice example I found on the internet with all the ways you can set the spring profile, it should help : https://www.baeldung.com/spring-profiles
Original Author Of This Content
Conclusion
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.