【发布时间】:2015-06-11 22:09:27
【问题描述】:
我有一个可以在多个生产环境中运行的应用。在一种环境中,我们希望使用 LDAP 进行身份验证,而在另一种环境中,我们不需要。如果 BuildConfig.groovy 中包含 Spring Security LDAP 插件,则非 LDAP 环境认证失败,因为没有配置 LDAP。
我试过了
environments {
devldap {
plugins {
compile ":spring-security-ldap:2.0-RC2"
}
}
}
但是 LDAP 插件仍然使用非 LDAP 环境构建,如果我不包含 LDAP 配置,则会导致非 LDAP 环境(在本例中为 development)无法进行身份验证,因为它无法连接到LDAP。
我试过了
grails clean
grails refresh-dependencies
但 LDAP 插件只有在我将其完全注释掉时才会卸载。
如何有条件地在我的构建中包含/排除插件?
【问题讨论】:
标签: grails spring-security spring-security-ldap