title: How to copy the dependency jar in a target folder through Maven
body: <p>I am trying to make a jar of a project and then copy it to a target folder but it is not working. Below is the POM. 'Maven Install' does create the jar but it doesn't copy it to the lib folder.</p>
  <p>pom.xml</p>
  <pre><code>&lt;build&gt;
  &lt;pluginManagement&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;${java.version}&lt;/source&gt;
                  &lt;target&gt;${java.version}&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;copy-dependencies&lt;/id&gt;
                      &lt;phase&gt;prepare-package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;copy-dependencies&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;outputDirectory&gt;/apps/dislocation/lib&lt;/outputDirectory&gt;
                          &lt;overWriteReleases&gt;false&lt;/overWriteReleases&gt;
                          &lt;overWriteSnapshots&gt;false&lt;/overWriteSnapshots&gt;
                          &lt;overWriteIfNewer&gt;true&lt;/overWriteIfNewer&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
  &lt;/build&gt;
  </code></pre>