@ConditionalOnMissingBean(name = "groovyAttributeRepositories")
        @Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public BeanContainer<PersonAttributeDao> groovyAttributeRepositories(
            final ConfigurableApplicationContext applicationContext,
            final CasConfigurationProperties casProperties) {
            return BeanSupplier.of(BeanContainer.class)
                .when(CONDITION.given(applicationContext.getEnvironment()))
                .supply(() -> {
                    val list = new ArrayList<PersonAttributeDao>();
                    casProperties.getAuthn().getAttributeRepository().getGroovy()
                        .stream()
                        .filter(groovy -> groovy.getLocation() != null)
                        .forEach(groovy -> {
                            val dao = new GroovyPersonAttributeDao(new InternalGroovyScriptDao(applicationContext, casProperties, groovy));
                            dao.setOrder(groovy.getOrder());
                            dao.setEnabled(groovy.getState() != AttributeRepositoryStates.DISABLED);
                            dao.putTag("state", groovy.getState());
                            FunctionUtils.doIfNotNull(groovy.getId(), id -> dao.setId(id));
                            LOGGER.debug("Configured Groovy attribute sources from [{}]", groovy.getLocation());
                            list.add(dao);
                        });
                    return BeanContainer.of(list);
                })
                .otherwise(BeanContainer::empty)
                .get();
        }
This is {@link CasPersonDirectoryGroovyConfiguration}.

@author Misagh Moayyed
@since 6.4.0
support/cas-server-support-person-directory/src/main/java/org/apereo/cas/config/CasPersonDirectoryGroovyConfiguration.java