Reputation: 35864
I've been running my Spring Boot (2.1.0) app via Gradle bootRun
but since adding in the Actuator, this causes the app to not actually shutdown when I tell IntelliJ to stop the app. For whatever reason, this is only an issue when running in Debug mode.
The solution I found online was to just run the Application.main() but now, my local profile isn't being picked up. So I have the typical application.yml
along with various other profiles. All of the developers have an application-local.yml
that is sitting at the root of the project and is ignored by git. Running Gradle's bootRun
with local
as the active profile works. But running Application.main()
with the local
active profile does not pick up the application-local.yml
file's config.
As you can see in the image, I've not only specified the profile in Intellij's Active profiles section, but also as a VM option just like I do when running via Gradle.
Upvotes: 4
Views: 6364
Reputation: 55
One more thing which you can try
Set spring.profiles.active=local
in Environment Variables below VM Options
Upvotes: 1