Grails 4:spring-security-ldap 是否针对 Grails 4.0 进行了更新?
Grails 4: Is spring-security-ldap updated for Grails 4.0?
我正在将我的 Grails 3.3.2 应用程序升级到 Grails 4.0.0.RC2,所有对 org.springframework.security.ldap 类 的引用都未解决。我不确定这是等待更高版本插件的问题,还是我应该为 Grails 4 做一些不同的事情。如果我需要等待更高版本,是否有 ETA?
我在我的 build.gradle 文件中使用这个版本:
compile "org.grails.plugins:spring-security-ldap:3.0.2"
下面是一些未解决错误的示例:
unable to resolve class org.springframework.ldap.core.DirContextOperations
unable to resolve class org.springframework.ldap.core.DirContextAdapter
由于 Gradle 更改:
Separation of compile and runtime dependencies when consuming POMs
要在 Grails 4 应用程序中使用某些 Grails 3 插件,您需要直接包含它们的传递依赖项。否则它们不会进入类路径。
修复方法是将依赖项直接包含在您的构建中。
ext {
springSecurityVersion="5.1.6.RELEASE"
springSecurityCoreVersion="4.0.0.RC2"
springSecurityLdapVersion="3.0.2"
}
dependencies {
...
// Security
compile "org.grails.plugins:spring-security-core:$springSecurityCoreVersion"
compile ("org.grails.plugins:spring-security-ldap:$springSecurityLdapVersion") {
exclude group: 'org.grails.plugins', module:'spring-security-core'
}
compile "org.springframework.security:spring-security-ldap:$springSecurityVersion", {
['apacheds-core', 'apacheds-core-entry', 'apacheds-protocol-ldap', 'apacheds-protocol-shared',
'apacheds-server-jndi', 'commons-logging', 'fest-assert', 'jcl-over-slf4j', 'junit',
'ldapsdk', 'logback-classic', 'mockito-core', 'shared-ldap', 'slf4j-api', 'spring-beans',
'spring-context', 'spring-core', 'spring-ldap-core', 'spring-security-core',
'spring-test', 'spring-tx'].each { exclude module: it }
}
compile 'org.springframework.ldap:spring-ldap-core:2.0.4.RELEASE', {
['commons-lang', 'gsbase', 'junit', 'mockito-core', 'powermock-api-mockito',
'powermock-api-support', 'powermock-core', 'powermock-module-junit4',
'powermock-module-junit4-common', 'powermock-reflect', 'slf4j-log4j12', 'spring-beans',
'spring-core', 'spring-data-commons', 'spring-test', 'spring-tx'].each { exclude module: it }
}
我从插件中获取了传递依赖:
https://github.com/grails-plugins/grails-spring-security-ldap/blob/master/build.gradle#L63-L76
我正在将我的 Grails 3.3.2 应用程序升级到 Grails 4.0.0.RC2,所有对 org.springframework.security.ldap 类 的引用都未解决。我不确定这是等待更高版本插件的问题,还是我应该为 Grails 4 做一些不同的事情。如果我需要等待更高版本,是否有 ETA?
我在我的 build.gradle 文件中使用这个版本:
compile "org.grails.plugins:spring-security-ldap:3.0.2"
下面是一些未解决错误的示例:
unable to resolve class org.springframework.ldap.core.DirContextOperations
unable to resolve class org.springframework.ldap.core.DirContextAdapter
由于 Gradle 更改:
Separation of compile and runtime dependencies when consuming POMs
要在 Grails 4 应用程序中使用某些 Grails 3 插件,您需要直接包含它们的传递依赖项。否则它们不会进入类路径。
修复方法是将依赖项直接包含在您的构建中。
ext {
springSecurityVersion="5.1.6.RELEASE"
springSecurityCoreVersion="4.0.0.RC2"
springSecurityLdapVersion="3.0.2"
}
dependencies {
...
// Security
compile "org.grails.plugins:spring-security-core:$springSecurityCoreVersion"
compile ("org.grails.plugins:spring-security-ldap:$springSecurityLdapVersion") {
exclude group: 'org.grails.plugins', module:'spring-security-core'
}
compile "org.springframework.security:spring-security-ldap:$springSecurityVersion", {
['apacheds-core', 'apacheds-core-entry', 'apacheds-protocol-ldap', 'apacheds-protocol-shared',
'apacheds-server-jndi', 'commons-logging', 'fest-assert', 'jcl-over-slf4j', 'junit',
'ldapsdk', 'logback-classic', 'mockito-core', 'shared-ldap', 'slf4j-api', 'spring-beans',
'spring-context', 'spring-core', 'spring-ldap-core', 'spring-security-core',
'spring-test', 'spring-tx'].each { exclude module: it }
}
compile 'org.springframework.ldap:spring-ldap-core:2.0.4.RELEASE', {
['commons-lang', 'gsbase', 'junit', 'mockito-core', 'powermock-api-mockito',
'powermock-api-support', 'powermock-core', 'powermock-module-junit4',
'powermock-module-junit4-common', 'powermock-reflect', 'slf4j-log4j12', 'spring-beans',
'spring-core', 'spring-data-commons', 'spring-test', 'spring-tx'].each { exclude module: it }
}
我从插件中获取了传递依赖:
https://github.com/grails-plugins/grails-spring-security-ldap/blob/master/build.gradle#L63-L76