title: how to download jar dependencies while installing jar into m2 repo
body: <p>I have a maven plugin jar which is already built on another machine , say test-1.0.0.jar . This jar have multiple dependencies like apache,plexus,maven etc .
  e.g.</p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.maven&lt;/groupId&gt;
          &lt;artifactId&gt;maven-core&lt;/artifactId&gt;
          &lt;version&gt;3.3.9&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.maven&lt;/groupId&gt;
        &lt;artifactId&gt;maven-plugin-api&lt;/artifactId&gt;
        &lt;version&gt;3.3.9&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.maven&lt;/groupId&gt;
        &lt;artifactId&gt;maven-compat&lt;/artifactId&gt;
        &lt;version&gt;3.3.9&lt;/version&gt;
      &lt;/dependency&gt;   
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.maven&lt;/groupId&gt;
        &lt;artifactId&gt;maven-embedder&lt;/artifactId&gt;
        &lt;version&gt;3.3.9&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.maven&lt;/groupId&gt;
        &lt;artifactId&gt;maven-archiver&lt;/artifactId&gt;
        &lt;version&gt;2.5&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;commons-io&lt;/groupId&gt;
        &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
        &lt;version&gt;2.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
        &lt;version&gt;3.5&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.maven.plugin-tools&lt;/groupId&gt;
        &lt;artifactId&gt;maven-plugin-annotations&lt;/artifactId&gt;
        &lt;version&gt;3.4&lt;/version&gt;
        &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.maven.surefire&lt;/groupId&gt;
        &lt;artifactId&gt;maven-surefire-common&lt;/artifactId&gt;
        &lt;version&gt;2.19.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.maven.surefire&lt;/groupId&gt;
        &lt;artifactId&gt;surefire-api&lt;/artifactId&gt;
        &lt;version&gt;2.19.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.codehaus.plexus&lt;/groupId&gt;
          &lt;artifactId&gt;plexus-component-annotations&lt;/artifactId&gt;
          &lt;version&gt;1.6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
         &lt;groupId&gt;org.apache.maven.surefire&lt;/groupId&gt;
         &lt;artifactId&gt;surefire-junit47&lt;/artifactId&gt;
         &lt;version&gt;2.19.1&lt;/version&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  </code></pre>
  
  <p>Now I want to use this jar for my maven project so I installed it in my local repository. when I install it using 'mvn install:install-file' command , it does not download all required dependencies for the jar in m2 repository. So when I use this plugin in my new maven project , it gives me classNotFound exception.</p>
  
  <pre><code>[WARNING] Error injecting: com.test.status.test.MyTestCompileMojo
  java.lang.NoClassDefFoundError: org/codehaus/plexus/compiler/util/scan/InclusionScanException
  </code></pre>
  
  <p>My projects POM - </p>
  
  <pre><code>&lt;project&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.check.status&lt;/groupId&gt;
    &lt;artifactId&gt;cf&lt;/artifactId&gt;
    &lt;version&gt;1.0.0&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;com.test.status&lt;/groupId&gt;
          &lt;artifactId&gt;test&lt;/artifactId&gt;
          &lt;version&gt;1.0.0&lt;/version&gt;
          &lt;extensions&gt;true&lt;/extensions&gt;
         &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
    &lt;dependencies/&gt;
  &lt;/project&gt;
  </code></pre>