When I try to compile any class in my project I get the error below:
Error scala: Output path .../eval/target/test-classes is shared between: Module \'eval\' tes
I had this happen with the root module in a multi-module project. Since the root module was just a placeholder, it didn't actually contain any code, but IDEA still complained that it was sharing an output path ([project]/build
) between test and production.
The fix was to add
plugins {
id "java"
}
at the top of the root build.gradle
file (applying the otherwise unnecessary Java plugin) and reimporting the project. This allowed IDEA to pick up the Java-default [project]/build/classes/main
and [project]/build/classes/test
output directories.