maven - Gradle 缺少传递依赖
问题描述
我在我的项目中导入了一个依赖项,它本身需要另一个(com.discord4j)。Gradle 似乎意识到了这种传递依赖,如下面的gradle dependencies
命令输出所示(discord4j 在编译和运行时显示为 com.bancarelvalentin.genericbot 的要求)。但我无法导入它,因为它的名称无法解析。
我不是 gradle 方面的专家,所以我肯定会遗漏一些明显的东西。任何人都可以帮助找到什么?
编辑:毕竟,传递依赖似乎没有添加到compileClasspath。为什么 ?
编辑 2:我修复了根库 POM 文件;它在此处可用,但上面的屏幕截图仍然是我在 compileClasspath 中得到的;我已经清除了所有缓存(InteliJ et Gradle),但男性 gradle 不会将该库放在类路径中
14:34:16: Executing task 'dependencies'...
> Task :dependencies
------------------------------------------------------------
Root project
------------------------------------------------------------
-api (n)
No dependencies
-runtime (n)
No dependencies
annotationProcessor - Annotation processors and their dependencies for source set 'main'.
No dependencies
api - API dependencies for compilation 'main' (target (jvm)). (n)
No dependencies
apiDependenciesMetadata
No dependencies
apiElements - API elements for main. (n)
No dependencies
archives - Configuration for archive artifacts. (n)
No dependencies
compileClasspath - Compile classpath for compilation 'main' (target (jvm)).
+--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10
| +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10
| \--- org.jetbrains:annotations:13.0
\--- com.bancarelvalentin:genericbot:0.0.4
compileOnly - Compile only dependencies for compilation 'main' (target (jvm)). (n)
No dependencies
compileOnlyDependenciesMetadata
No dependencies
default - Configuration for default artifacts. (n)
No dependencies
implementation - Implementation only dependencies for compilation 'main' (target (jvm)). (n)
+--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 (n)
\--- com.bancarelvalentin:genericbot:0.0.4 (n)
implementationDependenciesMetadata
+--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10
| +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10
| \--- org.jetbrains:annotations:13.0
\--- com.bancarelvalentin:genericbot:0.0.4
kotlinCompilerClasspath
\--- org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.10
+--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10
| +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10
| \--- org.jetbrains:annotations:13.0
+--- org.jetbrains.kotlin:kotlin-script-runtime:1.4.10
+--- org.jetbrains.kotlin:kotlin-reflect:1.4.10
| \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 (*)
+--- org.jetbrains.kotlin:kotlin-daemon-embeddable:1.4.10
\--- org.jetbrains.intellij.deps:trove4j:1.0.20181211
kotlinCompilerPluginClasspath
\--- org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.4.10
+--- org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.4.10
| +--- org.jetbrains.kotlin:kotlin-scripting-common:1.4.10
| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10
| | | +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10
| | | \--- org.jetbrains:annotations:13.0
| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7
| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.71 -> 1.4.10 (*)
| | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.71 -> 1.4.10
| +--- org.jetbrains.kotlin:kotlin-scripting-jvm:1.4.10
| | +--- org.jetbrains.kotlin:kotlin-script-runtime:1.4.10
| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 (*)
| | \--- org.jetbrains.kotlin:kotlin-scripting-common:1.4.10 (*)
| +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 (*)
| \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7 (*)
\--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 (*)
kotlinKlibCommonizerClasspath
\--- org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:1.4.10
+--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10
| +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10
| \--- org.jetbrains:annotations:13.0
\--- org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.10
+--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 (*)
+--- org.jetbrains.kotlin:kotlin-script-runtime:1.4.10
+--- org.jetbrains.kotlin:kotlin-reflect:1.4.10
| \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 (*)
+--- org.jetbrains.kotlin:kotlin-daemon-embeddable:1.4.10
\--- org.jetbrains.intellij.deps:trove4j:1.0.20181211
kotlinNativeCompilerPluginClasspath
No dependencies
kotlinScriptDef - Script filename extensions discovery classpath configuration
No dependencies
kotlinScriptDefExtensions
No dependencies
runtimeClasspath - Runtime classpath of compilation 'main' (target (jvm)).
+--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10
| +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10
| \--- org.jetbrains:annotations:13.0
\--- com.bancarelvalentin:genericbot:0.0.4
+--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 (*)
+--- com.discord4j:discord4j-core:3.1.0
| +--- io.projectreactor:reactor-bom:Dysprosium-SR10
| | +--- io.projectreactor.addons:reactor-extra:3.3.3.RELEASE (c)
| | +--- io.projectreactor.netty:reactor-netty:0.9.10.RELEASE (c)
| | +--- io.projectreactor:reactor-core:3.3.8.RELEASE (c)
| | \--- org.reactivestreams:reactive-streams:1.0.3 (c)
| +--- com.discord4j:discord-json:1.5.3
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.1
| | | +--- com.fasterxml.jackson.core:jackson-core:2.11.1
| | | \--- com.fasterxml.jackson.core:jackson-databind:2.11.1
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.11.1
| | | \--- com.fasterxml.jackson.core:jackson-core:2.11.1
| | +--- com.discord4j:discord-json-api:1.5.3
| | | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.1 (*)
| | | \--- com.fasterxml.jackson.core:jackson-databind:2.11.1 (*)
| | \--- com.fasterxml.jackson.core:jackson-databind:2.11.1 (*)
| +--- com.discord4j:discord4j-rest:3.1.0
| | +--- io.projectreactor:reactor-bom:Dysprosium-SR10 (*)
| | +--- com.discord4j:discord-json:1.5.3 (*)
| | \--- com.discord4j:discord4j-common:3.1.0
| | +--- io.projectreactor:reactor-bom:Dysprosium-SR10 (*)
| | +--- com.discord4j:discord-json:1.5.3 (*)
| | +--- io.projectreactor.netty:reactor-netty:0.9.10.RELEASE
| | | +--- io.netty:netty-codec-http:4.1.51.Final
| | | | +--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-buffer:4.1.51.Final
| | | | | \--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-transport:4.1.51.Final
| | | | | +--- io.netty:netty-common:4.1.51.Final
| | | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | | \--- io.netty:netty-resolver:4.1.51.Final
| | | | | \--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-codec:4.1.51.Final
| | | | | +--- io.netty:netty-common:4.1.51.Final
| | | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | | \--- io.netty:netty-transport:4.1.51.Final (*)
| | | | \--- io.netty:netty-handler:4.1.51.Final
| | | | +--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-resolver:4.1.51.Final (*)
| | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | +--- io.netty:netty-transport:4.1.51.Final (*)
| | | | \--- io.netty:netty-codec:4.1.51.Final (*)
| | | +--- io.netty:netty-codec-http2:4.1.51.Final
| | | | +--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | +--- io.netty:netty-transport:4.1.51.Final (*)
| | | | +--- io.netty:netty-codec:4.1.51.Final (*)
| | | | +--- io.netty:netty-handler:4.1.51.Final (*)
| | | | \--- io.netty:netty-codec-http:4.1.51.Final (*)
| | | +--- io.netty:netty-handler:4.1.51.Final (*)
| | | +--- io.netty:netty-handler-proxy:4.1.51.Final
| | | | +--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | +--- io.netty:netty-transport:4.1.51.Final (*)
| | | | +--- io.netty:netty-codec:4.1.51.Final (*)
| | | | +--- io.netty:netty-codec-socks:4.1.51.Final
| | | | | +--- io.netty:netty-common:4.1.51.Final
| | | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | | +--- io.netty:netty-transport:4.1.51.Final (*)
| | | | | \--- io.netty:netty-codec:4.1.51.Final (*)
| | | | \--- io.netty:netty-codec-http:4.1.51.Final (*)
| | | +--- io.netty:netty-transport-native-epoll:4.1.51.Final
| | | | +--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | +--- io.netty:netty-transport:4.1.51.Final (*)
| | | | \--- io.netty:netty-transport-native-unix-common:4.1.51.Final
| | | | +--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | \--- io.netty:netty-transport:4.1.51.Final (*)
| | | \--- io.projectreactor:reactor-core:3.3.8.RELEASE
| | | \--- org.reactivestreams:reactive-streams:1.0.3
| | +--- io.projectreactor.addons:reactor-extra:3.3.3.RELEASE
| | | \--- io.projectreactor:reactor-core:3.3.4.RELEASE -> 3.3.8.RELEASE (*)
| | +--- com.fasterxml.jackson.core:jackson-databind:2.11.1 (*)
| | \--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.1 (*)
| +--- com.discord4j:discord4j-gateway:3.1.0
| | +--- io.projectreactor:reactor-bom:Dysprosium-SR10 (*)
| | +--- com.discord4j:discord-json:1.5.3 (*)
| | +--- com.discord4j:discord4j-common:3.1.0 (*)
| | \--- io.projectreactor.addons:reactor-extra:3.3.3.RELEASE (*)
| +--- com.discord4j:discord4j-voice:3.1.0
| | +--- io.projectreactor:reactor-bom:Dysprosium-SR10 (*)
| | +--- com.discord4j:discord-json:1.5.3 (*)
| | +--- com.discord4j:discord4j-common:3.1.0 (*)
| | \--- com.discord4j:simple-fsm:1.0.1
| \--- com.discord4j:stores-jdk:3.1.3
| +--- io.projectreactor:reactor-bom:Dysprosium-SR10 (*)
| \--- com.discord4j:stores-api:3.1.3
| +--- io.projectreactor:reactor-bom:Dysprosium-SR10 (*)
| +--- io.projectreactor:reactor-core:3.3.8.RELEASE (*)
| +--- com.austinv11.servicer:Servicer:1.0.3
| \--- com.fasterxml.jackson.core:jackson-databind:2.11.1 (*)
+--- com.google.code.gson:gson:2.3.1
+--- ch.qos.logback:logback-classic:1.2.3
| +--- ch.qos.logback:logback-core:1.2.3
| \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
\--- org.slf4j:slf4j-api:1.7.30
runtimeElements - Elements of runtime for main. (n)
No dependencies
runtimeOnly - Runtime only dependencies for compilation 'main' (target (jvm)). (n)
No dependencies
runtimeOnlyDependenciesMetadata
No dependencies
sourceArtifacts (n)
No dependencies
testAnnotationProcessor - Annotation processors and their dependencies for source set 'test'.
No dependencies
testApi - API dependencies for compilation 'test' (target (jvm)). (n)
No dependencies
testApiDependenciesMetadata
No dependencies
testCompileClasspath - Compile classpath for compilation 'test' (target (jvm)).
+--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10
| +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10
| \--- org.jetbrains:annotations:13.0
\--- com.bancarelvalentin:genericbot:0.0.4
testCompileOnly - Compile only dependencies for compilation 'test' (target (jvm)). (n)
No dependencies
testCompileOnlyDependenciesMetadata
No dependencies
testImplementation - Implementation only dependencies for compilation 'test' (target (jvm)). (n)
No dependencies
testImplementationDependenciesMetadata
+--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10
| +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10
| \--- org.jetbrains:annotations:13.0
\--- com.bancarelvalentin:genericbot:0.0.4
testKotlinScriptDef - Script filename extensions discovery classpath configuration
No dependencies
testKotlinScriptDefExtensions
No dependencies
testRuntimeClasspath - Runtime classpath of compilation 'test' (target (jvm)).
+--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10
| +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10
| \--- org.jetbrains:annotations:13.0
\--- com.bancarelvalentin:genericbot:0.0.4
+--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 (*)
+--- com.discord4j:discord4j-core:3.1.0
| +--- io.projectreactor:reactor-bom:Dysprosium-SR10
| | +--- io.projectreactor.addons:reactor-extra:3.3.3.RELEASE (c)
| | +--- io.projectreactor.netty:reactor-netty:0.9.10.RELEASE (c)
| | +--- io.projectreactor:reactor-core:3.3.8.RELEASE (c)
| | \--- org.reactivestreams:reactive-streams:1.0.3 (c)
| +--- com.discord4j:discord-json:1.5.3
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.1
| | | +--- com.fasterxml.jackson.core:jackson-core:2.11.1
| | | \--- com.fasterxml.jackson.core:jackson-databind:2.11.1
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.11.1
| | | \--- com.fasterxml.jackson.core:jackson-core:2.11.1
| | +--- com.discord4j:discord-json-api:1.5.3
| | | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.1 (*)
| | | \--- com.fasterxml.jackson.core:jackson-databind:2.11.1 (*)
| | \--- com.fasterxml.jackson.core:jackson-databind:2.11.1 (*)
| +--- com.discord4j:discord4j-rest:3.1.0
| | +--- io.projectreactor:reactor-bom:Dysprosium-SR10 (*)
| | +--- com.discord4j:discord-json:1.5.3 (*)
| | \--- com.discord4j:discord4j-common:3.1.0
| | +--- io.projectreactor:reactor-bom:Dysprosium-SR10 (*)
| | +--- com.discord4j:discord-json:1.5.3 (*)
| | +--- io.projectreactor.netty:reactor-netty:0.9.10.RELEASE
| | | +--- io.netty:netty-codec-http:4.1.51.Final
| | | | +--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-buffer:4.1.51.Final
| | | | | \--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-transport:4.1.51.Final
| | | | | +--- io.netty:netty-common:4.1.51.Final
| | | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | | \--- io.netty:netty-resolver:4.1.51.Final
| | | | | \--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-codec:4.1.51.Final
| | | | | +--- io.netty:netty-common:4.1.51.Final
| | | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | | \--- io.netty:netty-transport:4.1.51.Final (*)
| | | | \--- io.netty:netty-handler:4.1.51.Final
| | | | +--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-resolver:4.1.51.Final (*)
| | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | +--- io.netty:netty-transport:4.1.51.Final (*)
| | | | \--- io.netty:netty-codec:4.1.51.Final (*)
| | | +--- io.netty:netty-codec-http2:4.1.51.Final
| | | | +--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | +--- io.netty:netty-transport:4.1.51.Final (*)
| | | | +--- io.netty:netty-codec:4.1.51.Final (*)
| | | | +--- io.netty:netty-handler:4.1.51.Final (*)
| | | | \--- io.netty:netty-codec-http:4.1.51.Final (*)
| | | +--- io.netty:netty-handler:4.1.51.Final (*)
| | | +--- io.netty:netty-handler-proxy:4.1.51.Final
| | | | +--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | +--- io.netty:netty-transport:4.1.51.Final (*)
| | | | +--- io.netty:netty-codec:4.1.51.Final (*)
| | | | +--- io.netty:netty-codec-socks:4.1.51.Final
| | | | | +--- io.netty:netty-common:4.1.51.Final
| | | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | | +--- io.netty:netty-transport:4.1.51.Final (*)
| | | | | \--- io.netty:netty-codec:4.1.51.Final (*)
| | | | \--- io.netty:netty-codec-http:4.1.51.Final (*)
| | | +--- io.netty:netty-transport-native-epoll:4.1.51.Final
| | | | +--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | +--- io.netty:netty-transport:4.1.51.Final (*)
| | | | \--- io.netty:netty-transport-native-unix-common:4.1.51.Final
| | | | +--- io.netty:netty-common:4.1.51.Final
| | | | +--- io.netty:netty-buffer:4.1.51.Final (*)
| | | | \--- io.netty:netty-transport:4.1.51.Final (*)
| | | \--- io.projectreactor:reactor-core:3.3.8.RELEASE
| | | \--- org.reactivestreams:reactive-streams:1.0.3
| | +--- io.projectreactor.addons:reactor-extra:3.3.3.RELEASE
| | | \--- io.projectreactor:reactor-core:3.3.4.RELEASE -> 3.3.8.RELEASE (*)
| | +--- com.fasterxml.jackson.core:jackson-databind:2.11.1 (*)
| | \--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.1 (*)
| +--- com.discord4j:discord4j-gateway:3.1.0
| | +--- io.projectreactor:reactor-bom:Dysprosium-SR10 (*)
| | +--- com.discord4j:discord-json:1.5.3 (*)
| | +--- com.discord4j:discord4j-common:3.1.0 (*)
| | \--- io.projectreactor.addons:reactor-extra:3.3.3.RELEASE (*)
| +--- com.discord4j:discord4j-voice:3.1.0
| | +--- io.projectreactor:reactor-bom:Dysprosium-SR10 (*)
| | +--- com.discord4j:discord-json:1.5.3 (*)
| | +--- com.discord4j:discord4j-common:3.1.0 (*)
| | \--- com.discord4j:simple-fsm:1.0.1
| \--- com.discord4j:stores-jdk:3.1.3
| +--- io.projectreactor:reactor-bom:Dysprosium-SR10 (*)
| \--- com.discord4j:stores-api:3.1.3
| +--- io.projectreactor:reactor-bom:Dysprosium-SR10 (*)
| +--- io.projectreactor:reactor-core:3.3.8.RELEASE (*)
| +--- com.austinv11.servicer:Servicer:1.0.3
| \--- com.fasterxml.jackson.core:jackson-databind:2.11.1 (*)
+--- com.google.code.gson:gson:2.3.1
+--- ch.qos.logback:logback-classic:1.2.3
| +--- ch.qos.logback:logback-core:1.2.3
| \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
\--- org.slf4j:slf4j-api:1.7.30
testRuntimeOnly - Runtime only dependencies for compilation 'test' (target (jvm)). (n)
No dependencies
testRuntimeOnlyDependenciesMetadata
No dependencies
(c) - dependency constraint
(*) - dependencies omitted (listed previously)
(n) - Not resolved (configuration is not meant to be resolved)
A web-based, searchable dependency report is available by adding the --scan option.
BUILD SUCCESSFUL in 116ms
1 actionable task: 1 executed
14:34:16: Task execution finished 'dependencies'.
解决方案
发布的 pom 是com.bancarelvalentin:genericbot
什么?
如果genericbot
模块只有runtime
依赖项,那么您将不会在编译类路径中看到它们,因此 IDE 不会检测到它们。
推荐阅读
- swift - 后台蓝牙(BLE)传输和扫描
- c++ - std::function 和 std::function 的比较
- c# - 为什么在动画师中改变两种状态之间的过渡时,它不会缓慢而平滑地改变它?
- javascript - Office Web 加载项缓存旧 js 代码
- ssis - SSIS 记录集目标不适用于时间列
- svg - SVG 路径定义中的逗号和小数点是否曾经本地化,例如“M1,23.4,56”?
- stanford-nlp - CRFClassifier 中的斯坦福 NLP 精度和召回率计算
- spring - 如何使用 Spring Boot 创建应用程序以读取 XLS 文件并存储在数据库中
- eclipse - Eclipse EMF UI ViewerPane
- swift - Swift 4 UILabel 动画颜色