Spring profile

A named set of configuration, such as local, test or production, that Spring activates to change properties and beans for one environment.

In more detail

The default configuration should be a safe baseline, and an active profile should add only the differences. Profile-specific beans can swap a fake client for tests. Profiles are not feature flags: changing one changes the application context and needs a restart.

Example

SPRING_PROFILES_ACTIVE=production

Related terms

Taught in

References