@Override
    public PropertySource load(final Resource resource,
                               final Environment environment,
                               final String name,
                               final CipherExecutor<String, String> configurationCipherExecutor) {
        val properties = new LinkedHashMap<>();
        val configSlurper = new ConfigSlurper();
        configSlurper.setClassLoader(ScriptingUtils.newGroovyClassLoader());

        val applicationProfiles = getApplicationProfiles(environment);
        applicationProfiles.forEach(Unchecked.consumer(profile -> {
            configSlurper.setEnvironment(profile);
            configSlurper.registerConditionalBlock("profiles", profile);
            val bindings = CollectionUtils.wrap("profile", profile, "logger", LOGGER);
            configSlurper.setBinding(bindings);
            val groovyConfig = configSlurper.parse(resource.getURL());
            val pp = groovyConfig.toProperties();
            LOGGER.debug("Found settings [{}] in Groovy file [{}]", pp.keySet(), resource);
            properties.putAll(pp);
        }));
        return finalizeProperties(name, decryptProperties(configurationCipherExecutor, properties));
    }
This is {@link GroovyConfigurationPropertiesLoader}.

@author Misagh Moayyed
@since 6.0.0
core/cas-server-core-scripting/src/main/java/org/apereo/cas/configuration/loader/GroovyConfigurationPropertiesLoader.java