I have a multiple projects gradle, in the top gradle is
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"
}
}
}
But it complains
> Could not find method sourceSets() for arguments [build_vgdvugn6hqrvg7eo53afh1229$_run_closure1_closure2@19962194] on root project 'testCom'.
So where should I put sourceSets?
Dependency types To add a dependency to your project, specify a dependency configuration such as implementation in the dependencies block of your module's build.gradle file.
Gradle has the concept of source sets for where your code and test sources live. Some Gradle plugins come with default source sets, for example the Java plugin has a "main" source set where the default location is src/main/java .
If you declare a module dependency, Gradle looks for a module metadata file ( . module , . pom or ivy. xml ) in the repositories.
The error message is a bit misleading, but before you can configure sourceSets.main.scala
, you'll have to apply the scala
plugin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With