我有以下 gradle 项目结构:
SUPER/
|______A/
| |______A1/
| | |______build.gradle
| |______A2/
| | |______build.gradle
| |______build.gradle
| |______settings.gradle
|
|______B/
| |______build.gradle
| |______settings.gradle
|
|______build.gradle
|______settings.gradle
我的 A-Project 中的 build.gradle包含以下内容:
...
project(":A1") {
apply plugin: "java-library"
dependencies {
api project(":A2")
}
}
project(":A2") {
apply plugin: "java-library"
dependencies {
...
}
}
...
我的“Super”-settings.gradle文件包含类似的内容:
rootProject.name = 'SUPER'
include 'A'
include 'B'
在我的子项目“A”中,settings.gradle 看起来像这样:
include 'A1', 'A2'
当从 SUPER 文件夹在命令行上像“ ./gradlew SUPER:A1:sometask
”那样调用 gradlewrapper 时,它会失败并显示以下消息:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\<somepath>\SUPER\A\build.gradle' line: 44
* What went wrong:
A problem occurred evaluating project ':A'.
> Project with path ':A1' could not be found in project ':A'.
./gradlew A1:sometask
但是,当从 A-sub-project-folder 中执行类似“ ”的操作时,它可以成功运行。
你能解释一下我在这里做错了什么吗?