postProcessEnvironment method

  1. @override
void postProcessEnvironment(
  1. ConfigurableEnvironment environment,
  2. SpringApplication application
)
override

Changes environment, the environment being prepared for application.

Called once per run. application gives access to settings such as SpringApplication.additionalProfiles. An error thrown here fails the start with the usual failure report.

Implementation

@override
void postProcessEnvironment(
  ConfigurableEnvironment environment,
  SpringApplication application,
) {
  final found = findRenamedProperties(environment.propertySources);
  if (found.isNotEmpty) {
    throw RenamedPropertiesException(found);
  }
}