title: Why does Maven create two jars for same source in target and groupId directory
body: <p>I have a Maven project with the <code>src</code> and <code>pom</code> having following <code>groupId</code> and <code>artifactId</code></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;groupId&gt;com.useless.coders&lt;/groupId&gt;
  &lt;artifactId&gt;nonsense-program&lt;/artifactId&gt;
  &lt;version&gt;0.0.1&lt;/version&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  </code></pre>
  
  <p>Now when we build the jar using <code>mvn clean install</code>, a target folder is created with the jar name and version as <code>nonsense-program-0.0.1</code> . When I navigate to <code>.m2</code> repository in the folder structure <code>com/useless/coders/</code> I can see the same jar is also created with extra metadata information in <code>maven-metadata-local.xml</code>. I know the purpose of Maven repository and as in <code>target</code> directory we house all output of the build with generated <code>.class</code> files with jar and/or libs.</p>
  
  <p>But I am curious to know why we maintain two jar copies of same source one in <code>target</code> directory and other in the <code>groupId</code> path directory. Wouldn't have we saved some space.</p>