Search code examples
javaspring-bootcommand-lineprofilejcmd

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


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?


Solution

  • 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