首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Grails 4: spring-security-ldap是否针对Grails 4.0进行了更新?

Grails 4: spring-security-ldap是否针对Grails 4.0进行了更新?
EN

Stack Overflow用户
提问于 2019-07-03 03:25:28
回答 1查看 299关注 0票数 2

我正在将Grails 3.3.2应用程序升级到Grails 4.0.0.RC2,所有对org.springframework.security.ldap类的引用都未解析。我不确定这是一个等待更新版本的插件的问题,还是我应该为Grails 4做一些不同的事情。如果我需要等待更新版本,有没有关于这个的ETA?

我在我的build.gradle文件中使用这个版本:

代码语言:javascript
复制
compile "org.grails.plugins:spring-security-ldap:3.0.2"  

以下是一些未解决的错误的示例:

代码语言:javascript
复制
unable to resolve class org.springframework.ldap.core.DirContextOperations
unable to resolve class org.springframework.ldap.core.DirContextAdapter
EN

回答 1

Stack Overflow用户

发布于 2019-10-29 14:41:54

由于Gradle更改:

Separation of compile and runtime dependencies when consuming POMs

要在Grails 4应用程序中使用一些Grails 3插件,您需要直接包含它们的传递依赖项。否则,它们不会被带到类路径中。

修复方法是将依赖项直接包含在您的构建中。

代码语言:javascript
复制
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

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56858897

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档