title: Sharing dependencies between maven modules
body: <p>I have the following structure:</p>
  
  <pre><code>main/
    --pom.xml
    --common/
        --pom.xml
    --core/
        --pom.xml
  </code></pre>
  
  <p>Both common and core are modules of the main projects, so main/pom.xml is like this:</p>
  
  <pre><code>&lt;project&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
    &lt;artifactId&gt;main&lt;/artifactId&gt;
    &lt;packaging&gt;pom&lt;/packaging&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;Main APP&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
    &lt;modules&gt;
        &lt;module&gt;common&lt;/module&gt;
        &lt;module&gt;core&lt;/module&gt;
    &lt;/modules&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Besides that, common/pom.xml is supposed to hold some common dependencies between all future modules. This is how common/pom.xml looks like for now:</p>
  
  <pre><code>&lt;project&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
      &lt;artifactId&gt;common&lt;/artifactId&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;mod1&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
  
      &lt;parent&gt;
          &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
          &lt;artifactId&gt;main&lt;/artifactId&gt;
          &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;common-dependency&lt;/groupId&gt;
                  &lt;artifactId&gt;common&lt;/artifactId&gt;
                  &lt;version&gt;3.8.1&lt;/version&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Finally, the module core should use dependencies defined in the common module, so this is what I done in core/pom.xml:</p>
  
  <pre><code>&lt;project&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
      &lt;artifactId&gt;core&lt;/artifactId&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;Core&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
          &lt;artifactId&gt;main&lt;/artifactId&gt;
          &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
                  &lt;artifactId&gt;common&lt;/artifactId&gt;
                  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>What I wanted is that when I run <code>mvn dependency:copy-dependencies</code> inside core module, maven should copy all the dependencies from common module, also (that common-dependency:common, for example). But actually what happens is that it do not copy any dependency, so it's like if core module didn't had any dependency at all.</p>
  
  <p>What am I missing here?</p>