title: X is already defined as trait X
body: <p>When I try to run a test file through <code>sbt-shell</code>, it runs fine(sbt testOnly a.b.MySpec)</p>
  <p>But when I try to run the same test file through intellij IDEA(2021.2.2 CE)'s green arrow <code>run</code> button, I gives this error</p>
  <pre><code>DriverFs2Grpc is already defined as trait DriverFs2Grpc
  trait DriverFs2Grpc[F[_], A] {
  </code></pre>
  <p>My project is a multi module sbt, scala project with the following structure.</p>
  <p><a href="https://i.stack.imgur.com/If6zY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/If6zY.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/8o6c3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8o6c3.png" alt="enter image description here" /></a></p>
  <p><code>DriverFs2Grpc</code> trait mentioned in the error message is an <strong>auto generated</strong> trait which resides in <code>target/scala-2.12/src_managed/main/fs2-grpc/packageX/DriverFs2Grpc.scala</code></p>
  <p>IntelliJ is trying to create a duplicate of the same file for some reason.</p>
  <p>I think this is caused by an invalid source configuration.</p>
  <p>My issue is similar to the question asked <a href="https://stackoverflow.com/questions/16885489/intellij-compile-failures-is-already-defined-as">here</a>, but still I couldn't figure it out.</p>
  <p>Appreciate any help to resolve this issue.</p>