title: Jar from child pom with own dependencies
body: <p>There is:</p>
  
  <p>Parent pom:</p>
  
  <pre><code>&lt;groupId&gt;practice&lt;/groupId&gt;
  &lt;artifactId&gt;app&lt;/artifactId&gt;
  &lt;packaging&gt;pom&lt;/packaging&gt;
  &lt;version&gt;1.0&lt;/version&gt;
  
  &lt;modules&gt;
      &lt;module&gt;h2db&lt;/module&gt;
  &lt;/modules&gt;
  
  &lt;build&gt;
      &lt;pluginManagement&gt;
      ...
      &lt;/pluginManagement&gt;
  &lt;/build&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;version&gt;1.2.17&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.h2database&lt;/groupId&gt;
          &lt;artifactId&gt;h2&lt;/artifactId&gt;
          &lt;version&gt;1.4.185&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>Child pom:</p>
  
  <pre><code>&lt;parent&gt;
      &lt;artifactId&gt;app&lt;/artifactId&gt;
      &lt;groupId&gt;practice&lt;/groupId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;artifactId&gt;h2db&lt;/artifactId&gt;
  &lt;build&gt;
      &lt;finalName&gt;h2db&lt;/finalName&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.0.2&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;archive&gt;
                      &lt;manifest&gt;
                          &lt;addClasspath&gt;true&lt;/addClasspath&gt;
                          &lt;mainClass&gt;h2_server.H2ConsoleServer&lt;/mainClass&gt;
                      &lt;/manifest&gt;
                  &lt;/archive&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.h2database&lt;/groupId&gt;
          &lt;artifactId&gt;h2&lt;/artifactId&gt;
          &lt;version&gt;1.4.185&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>In this example these is a parent pom that has 2 (or more) dependencies. Child pom has only one dependency that it needs. Is it possible for me to build a jar from this child pom module and include (scope:compile) it's single dependency into it? It builds a jar but does not include h2-dependency in the jar file. I've tried to use <code>maven-assembly-plugin</code> with <code>jar-with-dependencies</code> in the child pom but as a result it made a jar with all dependencies from the parent pom.</p>