How to exceute spring boot api with maven profile?

Hi community! I have a doubt about how can I run a spring boot api manually. I need to do this: java -jar -Dspring.profiles.active=dev xxx.jar

I tried override the run command with command above, the application initialize, but never is healthy. Other option that I tried is the Procfile in the root of project, but I have the same error.

Somebody could help me?

Thanks!

Cheers!

Hi,

I briefly looked at the logs of your service and noticed the port used by your application doesn’t match the one defined in your service configuration.

Can you update your custom run command by adding the following option to setup up the HTTP port of your app to 8000 --server.port=8000?

Hi Edouard,

Yes, i added the flag -Dserver.port=8000 to the run command and it worked ok.
Run command was:
java -jar -Dspring.profiles.active=dev -Dserver.port=8000 target/trekking-0.0.1-SNAPSHOT.jar

Thanks for your reply.

Regards,
Gonzalo.