title: "Class already exists" error in IntelliJ on Groovy class
body: <p>in IntelliJ (2016.2 and previous) we have our Groovy classes marked red with the error "class  already exists".
  I think we can exclude that the cause is the stub-generation, as this is deactivated.</p>
  
  <p>Probably it's caused in our constellation: We have included our compiled groovy (and java) classes in a jar that is registered as dependency.</p>
  
  <p>Dependency MyProduct.jar contains <code>com.mycompany.MyGroovyClass</code></p>
  
  <p>Our source contains <code>com.mycompany.MyGroovyClass</code></p>
  
  <p>The error disappears if the dependency is registered with Test-Scope, in all other scopes the error appears.</p>
  
  <p>However, in our structure we kinda <em>have</em> to include the compiled classes in a compile scope, as we want to avoid that each developer needs to compile all classes (I know about the compile in background ability, but we have a constellation that prevents this from working).</p>
  
  <p>We have no errors in <code>com.mycompany.MyJavaClass</code> which exists as well in source and in MyProduct.jar.</p>
  
  <p>Any ideas on how we can solve this?</p>