Output path is shared between the same module error

后端 未结 13 2154
天涯浪人
天涯浪人 2021-02-01 13:16

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         


        
13条回答
  •  面向向阳花
    2021-02-01 13:32

    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.

提交回复
热议问题