Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Spring Boot Run Configuratipon in IntelliJ

I use this command to run my spring application - java -jar -Dspring.profiles.active=native ddwa-services-app/target/ddwa-services-app-1.0-SNAPSHOT.jar, but when run the application from IDE, I need to add run configuration, below is the screenshot showing what I have added, but it does not work for me.

enter image description here

like image 420
abhi Avatar asked Oct 30 '25 14:10

abhi


1 Answers

Looking at my working Spring Boot 2.0.4 app configuration, I can suggest you to try these:

  • Correct syntax for spring profiles is --spring.profiles.active=yourprofile in Program Arguments

  • Working directory should be set to your application root folder.

I also don't have separate Active Profiles field highlighted on your screenshot.

This is my working configuration: enter image description here

We also run our app as :

java -Dproperty=value -jar path/ourapp.jar --spring.profiles.active=ourprofile

Actually, both variants of active profile configuration are correct - see Setting active profile and config location from command line in spring boot

like image 57
arghtype Avatar answered Nov 02 '25 03:11

arghtype