2 回答

TA貢獻(xiàn)1864條經(jīng)驗(yàn) 獲得超2個(gè)贊
另一種選擇是將組織.nrg.xnat:web 的依賴項(xiàng)配置從編譯或?qū)崿F(xiàn)更改為僅編譯。這使您可以為插件聲明較少的依賴項(xiàng),因?yàn)槟梢栽试S傳遞依賴項(xiàng)。ECS 依賴關(guān)系來(lái)自 XNAT 本身的類,因此允許傳遞依賴關(guān)系意味著您不必聲明可能間接引用的所有內(nèi)容。我剛剛在XNAT LDAP身份驗(yàn)證插件中進(jìn)行了此更改,然后從以下位置開始:
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
}
對(duì)此:
compileOnly "org.nrg.xnat:web"
compileOnly "org.springframework.security:spring-security-ldap"
compileOnly "org.slf4j:slf4j-nop"
如果您運(yùn)行此命令:
$ ./gradlew dependencies
你會(huì)看到 ecs:ecs:1.4.2 通過許多可傳遞的依賴項(xiàng)被拉入。

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