I have an application that has two profiles and it also takes a command line argument. I would like to run this application using java jar
command but everytime I do that, only the default
profile gets picked up.
application.properties (default profile)
endpoint=http://localhost:9999/success
application-prod.properties (prod profile)
endpoint=http://prod.server:5000/success
I tried executing following commands and both the time only the default
profile got picked up.
java -jar target/app.jar hello
java -jar target/app.jar hello -Pprod
Am I passing the spring boot profile name the correct way ?
Also please advise if this can be achieved using mvn spring-boot:run
command?