customizePropertySources method

  1. @override
void customizePropertySources(
  1. MutablePropertySources propertySources
)
override

Called during construction to allow subclasses to register default property sources.

Override this method in your custom environment implementation to add system properties, YAML or map-based configuration sources, etc.

Example

@override
void customizePropertySources(MutablePropertySources sources) {
  sources.addLast(MapPropertySource('app', {
    'env': 'production',
    'debug': 'false',
  }));
}

Implementation

@override
void customizePropertySources(MutablePropertySources propertySources) {
  propertySources.addAll(propertySources.toList());
  propertySources.addLast(SystemEnvironmentPropertySource(SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, getSystemProperties()));
  propertySources.addLast(SystemEnvironmentPropertySource(SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, getSystemEnvironment()));
}