I’m new to multimodule approach and I’d like to make it right.
I had an application with just one main module and it was easy in the way that all the definitions went to build.gradle.kts in the root of the project.
Now I wanted to turn it to multimodule project with buildSrc and suddenly where belongs what is not clear enough.
I wonder where to put following things and why:
- definitions like
java {
toolchain {
languageVersion = JavaLanguageVersion.of(libs.versions.java.get())
}
}
kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict")
}
}
- basic SpringBoot variables like group and version which are applicable to whole project
- definition of general tasks that should apply to all submodules - like sonar task
There are basically 3 candidate files:
- build.gradle.kts in the root of the project
- build.gradle.kts in the buildSrc dir
- java-conventions.gradle.kts file in the buildSrc/src/main/kotlin dir
Can anybody explain where should things mentioned above go and why??
Thanks a lot!