我有一个多项目gradle,在顶层gradle是
subprojects {
apply plugin: "java"
sourceSets {
main {
scala {
srcDirs = ['src/main/scala', 'src/main/java']
}
java {
srcDirs = []
}
}
}
repositories {
mavenCentral()
maven {
url "http://repo.springsource.org/milestone"
}
}
}
但它抱怨
> Could not find method sourceSets() for arguments [build_vgdvugn6hqrvg7eo53afh1229$_run_closure1_closure2@19962194] on root project 'testCom'.
那么我应该在哪里放置sourceSets?
答案 0 :(得分:5)
错误消息有点误导,但在配置sourceSets.main.scala
之前,您必须应用scala
插件。