gpt4 book ai didi

java - 为什么 gradle 不返回其他项目的依赖关系?

转载 作者:太空宇宙 更新时间:2023-11-04 06:21:47 24 4
gpt4 key购买 nike

我有以下构建脚本(webapp:build.gradle):

apply plugin: 'java'

dependencies {
project(':api')
}

当我在命令行中运行 gradle dependency webapp:dependencies 时,我得到:

:dependencies

------------------------------------------------------------
Root project
------------------------------------------------------------

No configurations
:webapp:dependencies

------------------------------------------------------------
Project :webapp
------------------------------------------------------------

archives - Configuration for archive artifacts.
No dependencies

compile - Compile classpath for source set 'main'.
No dependencies

default - Configuration for default artifacts.
No dependencies

runtime - Runtime classpath for source set 'main'.
No dependencies

testCompile - Compile classpath for source set 'test'.
No dependencies

testRuntime - Runtime classpath for source set 'test'.
No dependencies

关于 api 项目的依赖关系没有什么可说的。为什么?怎么了?

最佳答案

因为您尚未为此依赖项指定配置名称。应该是例如:

dependencies {
compile project(':api')
}

webapp/build.gradle

apply plugin: 'java'

dependencies {
compile project(':api')
}

webapp/settings.gradle

include 'api'

webapp/api/build.gradle

apply plugin: 'java'

关于java - 为什么 gradle 不返回其他项目的依赖关系?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27341127/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com