title: Maven doesn't find imported class from another module but Intellij does
body: <p>I have multi-module maven project. The <strong>acceptance-tests</strong> module has dependency from <strong>api</strong> module in <strong>pom.xml</strong> (Replacing real company name by <strong><em>xxx</em></strong> to keep confidentiality). I am trying to import some classes from <strong>api</strong> module in my <strong>acceptance-tests</strong>.</p>
  
  <p>Here is my <strong>pom.xml</strong> dependency of <strong>acceptance-tests</strong> module:</p>
  
  <pre><code>        &lt;dependency&gt;
              &lt;artifactId&gt;xxx-api&lt;/artifactId&gt;
              &lt;groupId&gt;com.xxx&lt;/groupId&gt;
              &lt;version&gt;${xxx.api.version}&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>The <strong>api</strong> module separately is being installed and packaged (<strong>mvn install</strong>, <strong>mvn package</strong>) by maven without any issue. The <strong>jar</strong> file is being created in my local <strong>.m2</strong>.</p>
  
  <p>However, when I try to compile the <strong>acceptance-tests</strong> module, I get a compilation error saying that the the classes cannot be imported because the package is not found.</p>
  
  <p>Here is the actual error:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project xxx-acceptance-tests: Compilation failure: Compilation failure: 
  [ERROR] /Users/andranik_chorokhyan/mydisk/Projects/XXX/automation/xxx-project-test-automation/xxx-acceptance-tests/src/main/java/com/xxx/xxx/utilities/api/ApiPayloadUtils.java:[17,38] package com.xxx.domain.dto does not exist
  [ERROR] /Users/andranik_chorokhyan/mydisk/Projects/XXX/automation/xxx-project-test-automation/xxx-acceptance-tests/src/main/java/com/xxx/xxx/utilities/api/ApiPayloadUtils.java:[18,38] package com.xxx.domain.dto does not exist
  [ERROR]   symbol:   class MappingData
  [ERROR]   location: class com.xxx.utilities.api.ApiPayloadUtils
  </code></pre>
  
  <p>One more interesting fact is that there is no error visible in Intellij IDEA. No red underline, no compilation error, no problem with navigating to the appropriate imported file.
  And in reality, the <strong>com.xxx.domain.dto</strong> package does exist and the <strong>MappingData</strong> class as well.</p>
  
  <p>I removed whole <strong>xxx</strong> directory from my local <strong>.m2</strong> repository and executed <code>mvn clean dependency:resolve</code> command. It succeeded as well.</p>
  
  <p>Does anybody know what's the problem here and how it can be solved?
  Thanks in advance!</p>