Reputation: 31
I am trying to set the profile as dev,but the spring boot app does not start in dev profile.No active profile set, falling back to default profiles: default
.
i am running with the command :java -jar myapp.jar -Dspring.profiles.active=dev
Upvotes: 1
Views: 1797
Reputation:
It's important that the -D parameters are before your application.jar otherwise they are not recognized.
java -jar -Dspring.profiles.active=dev app.jar
or
mvn spring-boot:run -Drun.profiles=dev
Upvotes: 1
Reputation: 31
I was able to run it with the following: java -jar myapp.jar **--**spring.profiles.active=dev
Note that it needs to be -- and elimination of D
Upvotes: 2
Reputation: 27078
This is the right way to execute
java -Dspring.profiles.active=dev -jar myapp.jar
Upvotes: 1