我有一个像这样的项目:
在root build.gralde中,我定义了所有子模块所需的第三方依赖关系。但是,在intellij中,子模块似乎无法识别依赖性并且不会编译。我过去看过这项工作,无法弄清楚我在做什么错
root build.gradle 插件{ id'java' }
2>error.log: Invalid argument
settings.gradle
group 'com.XXX'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
allprojects {
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
}
dependencies {
...
}
module1 build.gradle
rootProject.name = 'XXX'
include 'module1'
include 'module2'
答案 0 :(得分:0)
我意识到我只需要将依赖项放在“ subprojects”块中的root build.gradle中,并添加Java插件。
subprojects {
apply plugin: 'java'
dependencies {
...
}
}