Search code examples
spring-tool-suite

How to create spring boot profile for selection in spring boot run configuration


Does anyone know how you create spring boot profiles to use in a spring boot run configuration? I know I can --spring.profiles.active=dev as launch param, but there is a section in the gui of a spring boot launch config. But I can't seem to get the profiles to populate the drop down.


Solution

  • Let me try to give a more complete answer than Alex's. Alex is right that you can just type any string there and use it as a profile. (This has the same effect as adding something like --spring.profiles.active=dev to the commandline.

    The pull-down options come from two sources:

    1. history: when you launch the app the current setting for that option is remembered and will be shown to you next time in the pull-down.

    2. discovery: the tools will try to 'guess' real profiles you have defined in your project.

    Option 2. at the moment is not very smart and the only way it can currently discover that you defined a profile is by looking for .properties files that follow the naming convention application-${profile-name}.properties.