我面临以下问题。我在同一层次结构上有两个 Gradle 项目(ProjectA 和 ProjectB),没有任何根项目。由于 ProjectA 依赖于 ProjectB,因此我尝试将其建模如下:
ProjectA 的settings.gradle:
includeFlat 'ProjectB'
ProjectA 的build.gradle:
dependencies {
compile project(':ProjectB')
}
但是,在 ProjectA 上执行“gradle build”时出现以下错误:
* What went wrong:
A problem occurred evaluating root project 'ProjectA'.
> Could not resolve all dependencies for configuration ':compile'.
> Module version group:, module:ProjectA, version:0.0.1-SNAPSHOT, configuration:compile declares a dependency on configuration 'default' which is not declared in the module descriptor for group:ProjectA, module:ProjectB, version:unspecified
我是否必须在 ProjectB 中定义某种默认配置?