我在我的项目中导入了一个依赖项,这个依赖项本身需要另一个依赖项(com.discord4j)。Gradle似乎意识到了这种传递依赖关系,如下面的gradle dependencies
命令的输出所示(在编译和运行时,discord4j按照com.bancarelvalentin.genericbot的要求显示)。但是我不能导入它,因为它的名称无法解析。
当涉及到gradle时,我不是专家,所以我肯定遗漏了一些明显的东西。谁能帮我找到什么?
编辑:毕竟,传递依赖似乎并没有添加到compileClasspath中。为什么?
编辑2:我修复了根库POM文件;它是可用的here,但上面的屏幕截图仍然是我在compileClasspath中得到的;我已经清除了所有缓存(InteliJ et Gradle),但male 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'.
发布于 2020-11-10 17:24:46
com.bancarelvalentin:genericbot
发布的pom是什么?
如果genericbot
模块只有runtime
依赖项,那么在编译类路径中看不到它们,因此集成开发环境不会检测到它们。
https://stackoverflow.com/questions/64769967
复制相似问题