title: Intellij IDEA includes other module that is already included by Maven
body: <p>I've got a 2-module Intellij project that is Maven-based and is organized like this:</p>
  
  <pre><code>MyAppProject
      ---&gt;MyAppDomain (builds a JAR)
      ---&gt;MyAppWAR (builds a WAR, including the JAR above)
  </code></pre>
  
  <p>I can build the project using Maven, and the resulting WAR contains MyAppDomain.JAR as a dependency:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.mycompany.myapp&lt;/groupId&gt;
      &lt;artifactId&gt;MyAppDomain&lt;/artifactId&gt;
      &lt;version&gt;1.0.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>This WAR works in Tomcat.  However, if I build it using Intellij Idea Ultimate's neat Tomcat integration, WAR fails with this error (formatted for readability):</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: 
  Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0': 
  Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: 
  Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/config/data-context.xml]: 
  Invocation of init method failed; nested exception is java.lang.IllegalStateException: 
  Conflicting persistence unit definitions for name 'caPersistenceUnit': 
  file:/C:/JavaSoftware/apache-tomcat-6.0.32/webapps/MyApplication/WEB-INF/lib/MyAppDomain.jar, file:/C:/JavaSoftware/apache-tomcat-6.0.32/webapps/MyApplication/WEB-INF/lib/MyAppDomain-1.0.0.jar
  </code></pre>
  
  <p>So, it appears that IDEA is including the Maven-specified JAR (MyAppDomain-1.0.0.jar)  and also including it's own version of this JAR (MyAppDomain.jar) containing all the same files.  </p>
  
  <p>I have searched in vain for a way to turn this off in Intellij IDEA - does anybody know how to stop this behavior (including co-resident projects)?</p>