@Override
    public Optional<PropertySource<?>> locate(final Environment environment, final ResourceLoader resourceLoader) {
        val compositePropertySource = new CompositePropertySource("casCompositePropertySource");
        compositePropertySource.addPropertySource(loadEnvironmentAndSystemProperties());
        val config = CasConfigurationPropertiesSourceLocator.getStandaloneProfileConfigurationDirectory(environment);
        LOGGER.debug("Located CAS standalone configuration directory at [{}]", config);
        if (config != null && config.isDirectory() && config.exists()) {
            val sourceProfiles = loadSettingsByApplicationProfiles(environment, config);
            if (!sourceProfiles.getPropertySources().isEmpty()) {
                compositePropertySource.addPropertySource(sourceProfiles);
            }
        } else {
            LOGGER.info("Configuration directory [{}] is not a directory or cannot be found at the specific path",
                FunctionUtils.doIfNotNull(config, () -> config, () -> "unspecified").get());
        }

        val embeddedProperties = loadEmbeddedProperties(resourceLoader, environment);
        compositePropertySource.addPropertySource(embeddedProperties);

        return Optional.of(compositePropertySource);
    }
Adding items to composite property source which contains
property sources processed in order, first one wins.
First Priority: System properties and environment variables,
Second Priority: Configuration files in config dir,
profiles override non-profiles, last profile overrides first
Third Priority: {@code classpath:/application.yml}

@param environment    the environment
@param resourceLoader the resource loader
@return CompositePropertySource containing sources listed above
core/cas-server-core-configuration-api/src/main/java/org/apereo/cas/configuration/DefaultCasConfigurationPropertiesSourceLocator.java