title: Maven multimodule dependency not found
body: <p>I am getting a quite odd error that I can't seem to explain.</p>
  
  <p>I have a multimodule maven project where I've built a module that tests the integration between two other modules.</p>
  
  <p>So pretty much something like this:</p>
  
  <pre><code>root
  |
  +--dispatcher
  |
  +--worker
  |
  +--tester
  </code></pre>
  
  <p>and if I run the tester with IntelliJ everything is fine, however running it through maven fails.
  And it fails because it cannot find a specific package, not because it cannot find the artifact.</p>
  
  <p>I have tried creating a new project to test the concept behind module dependencies and it seems to work, but I cannot seem to find why.</p>
  
  <p>So these are the pom files:</p>
  
  <p>Parent:</p>
  
  <pre><code>&lt;project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://maven.apache.org/POM/4.0.0"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;se.group&lt;/groupId&gt;
    &lt;artifactId&gt;parentid&lt;/artifactId&gt;
    &lt;version&gt;0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;pom&lt;/packaging&gt;
    &lt;description&gt;Parent project for all maven modules.&lt;/description&gt;
  
    &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;2.0.3.RELEASE&lt;/version&gt;
      &lt;relativePath/&gt;
    &lt;/parent&gt;
  
    &lt;modules&gt;
      &lt;module&gt;worker&lt;/module&gt;
      &lt;module&gt;dispatcher&lt;/module&gt;
      &lt;module&gt;service-testing&lt;/module&gt;
    &lt;/modules&gt;
  ...
  &lt;/project&gt;
  </code></pre>
  
  <p>Dispatcher:</p>
  
  <pre><code>&lt;project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://maven.apache.org/POM/4.0.0"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;artifactId&gt;dispatcher&lt;/artifactId&gt;
    &lt;version&gt;0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
    &lt;name&gt;dispatcher&lt;/name&gt;
  
    &lt;parent&gt;
      &lt;groupId&gt;se.group&lt;/groupId&gt;
      &lt;artifactId&gt;parentid&lt;/artifactId&gt;
      &lt;version&gt;0.1-SNAPSHOT&lt;/version&gt;
    &lt;/parent&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;project.version&gt;${project.version}&lt;/project.version&gt;
    &lt;/properties&gt;
  
    &lt;scm&gt;
      &lt;developerConnection&gt;
        scm:git:https://ghe.com/dispatcher.git
      &lt;/developerConnection&gt;
      &lt;connection&gt;scm:git:https://ghe.com/dispatcher.git
      &lt;/connection&gt;
      &lt;url&gt;https://ghe.com/dispatcher&lt;/url&gt;
      &lt;tag&gt;HEAD&lt;/tag&gt;
    &lt;/scm&gt;
  
    &lt;distributionManagement&gt;
      &lt;repository&gt;
        &lt;id&gt;releases&lt;/id&gt;
        &lt;url&gt;http://nexus.net/repository/maven-releases&lt;/url&gt;
      &lt;/repository&gt;
      &lt;snapshotRepository&gt;
        &lt;id&gt;snapshots&lt;/id&gt;
        &lt;url&gt;http://nexus.net/repository/maven-snapshots&lt;/url&gt;
      &lt;/snapshotRepository&gt;
    &lt;/distributionManagement&gt;
  ...
  &lt;/project&gt;
  </code></pre>
  
  <p>And tester:</p>
  
  <pre><code>&lt;project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://maven.apache.org/POM/4.0.0"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;artifactId&gt;systemtest&lt;/artifactId&gt;
    &lt;version&gt;0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
    &lt;name&gt;systemtest&lt;/name&gt;
  
    &lt;parent&gt;
      &lt;groupId&gt;se.group&lt;/groupId&gt;
      &lt;artifactId&gt;parentid&lt;/artifactId&gt;
      &lt;version&gt;0.1-SNAPSHOT&lt;/version&gt;
    &lt;/parent&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;project.version&gt;${project.version}&lt;/project.version&gt;
    &lt;/properties&gt;
  
    &lt;scm&gt;
      &lt;developerConnection&gt;
        scm:git:https://ghe.com/dispatcher.git
      &lt;/developerConnection&gt;
      &lt;connection&gt;scm:git:https://ghe.com/dispatcher.git
      &lt;/connection&gt;
      &lt;url&gt;https://ghe.com/dispatcher&lt;/url&gt;
      &lt;tag&gt;HEAD&lt;/tag&gt;
    &lt;/scm&gt;
  
    &lt;distributionManagement&gt;
      &lt;repository&gt;
        &lt;id&gt;releases&lt;/id&gt;
        &lt;url&gt;http://nexus.net/repository/maven-releases&lt;/url&gt;
      &lt;/repository&gt;
      &lt;snapshotRepository&gt;
        &lt;id&gt;snapshots&lt;/id&gt;
        &lt;url&gt;http://nexus.net/repository/maven-snapshots&lt;/url&gt;
      &lt;/snapshotRepository&gt;
    &lt;/distributionManagement&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;se.group&lt;/groupId&gt;
        &lt;artifactId&gt;dispatcher&lt;/artifactId&gt;
        &lt;version&gt;0.1-SNAPSHOT&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  ...
  &lt;/project&gt;
  </code></pre>
  
  <p>This should work right?</p>
  
  <p>Ok, this is kind of odd I think.
  If I run <code>mvn clean install</code> it breaks, but it seems as if it works if I run <code>mvn clean package install</code></p>