How to get a running springboot applcation's active profiles from the command line?

525 Views Asked by At

How do you get the active profile from a running spring boot application from the command-line?

I know about jcmd but I could not find anything that references the springboot properties.

Is there another way or am I missing something with jcmd?

1

There are 1 best solutions below

3
Attila T On BEST ANSWER

If you own the application, i.e. you have access to the source code and permission to change it, you can enable the /env Actuator end-point which should give you the names of the active profiles. You can call this end-point from command line using cURL, for example.

Ref.: Retrieving the Entire Environment