2 回答

TA貢獻1864條經驗 獲得超2個贊
另一種選擇是將組織.nrg.xnat:web 的依賴項配置從編譯或實現更改為僅編譯。這使您可以為插件聲明較少的依賴項,因為您可以允許傳遞依賴項。ECS 依賴關系來自 XNAT 本身的類,因此允許傳遞依賴關系意味著您不必聲明可能間接引用的所有內容。我剛剛在XNAT LDAP身份驗證插件中進行了此更改,然后從以下位置開始:
implementation("org.nrg.xnat:web") {
transitive = false
}
implementation("org.nrg.xnat:xnat-data-models") {
transitive = false
}
implementation("org.nrg.xdat:core") {
transitive = false
}
implementation("org.nrg:prefs") {
transitive = false
}
implementation("org.nrg:framework") {
transitive = false
}
implementation "org.springframework:spring-web"
implementation "org.springframework.security:spring-security-config"
implementation "org.springframework.security:spring-security-ldap"
implementation "org.apache.commons:commons-lang3"
implementation "org.hibernate.javax.persistence:hibernate-jpa-2.1-api"
implementation "com.google.guava:guava"
implementation "org.slf4j:slf4j-api"
implementation "log4j:log4j"
implementation "org.springframework.security:spring-security-web"
implementation "javax.servlet:javax.servlet-api"
compileOnly "com.google.code.findbugs:jsr305"
compileOnly "org.apache.ivy:ivy:2.4.0"
compileOnly("stratum:stratum") {
transitive = false
}
對此:
compileOnly "org.nrg.xnat:web"
compileOnly "org.springframework.security:spring-security-ldap"
compileOnly "org.slf4j:slf4j-nop"
如果您運行此命令:
$ ./gradlew dependencies
你會看到 ecs:ecs:1.4.2 通過許多可傳遞的依賴項被拉入。

TA貢獻1851條經驗 獲得超5個贊
org.apache.ecs.ConcreteElement
來自阿帕奇元素構造集 (ECS),例如包含在 ecs-1.4.2.jar
。
要解決此問題,請向文件添加依賴項,如下所示:build.gradle
// compile group: 'ecs', name: 'ecs', version: '1.4.2'
添加回答
舉報