Setting local repository ID when installing POMs : <p>I need a local repository for my project for a JAR file not available via the Maven Central repository. I install my JAR using <code>mvn install:install-file …</code> as per <a href="http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html" rel="noreferrer">http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html</a>, using <code>-DlocalRepositoryPath</code> to indicate the path in my Git repository, and using <code>-DcreateChecksum</code> to create checksums.</p>

<p>This installs the JAR, generates a POM, and generates checksums for all the files. But interestingly it also creates a <code>maven-metadata-local.xml</code> file in the groupId directory. From <a href="http://maven.apache.org/ref/3.2.5/maven-repository-metadata/" rel="noreferrer">http://maven.apache.org/ref/3.2.5/maven-repository-metadata/</a> I gather that <code>local</code> is the ID it is giving the local repository.</p>

<p>But in my POM (<code>mvn install:install-file</code> had no way of knowing) I use the ID <code>local-repo</code> for my repository:</p>

<pre><code>&lt;repositories&gt;
  &lt;repository&gt;
    &lt;id&gt;local-repo&lt;/id&gt;
    &lt;url&gt;file:///${project.basedir}/repo&lt;/url&gt;
  &lt;/repository&gt;
&lt;/repositories&gt;
</code></pre>

<p>Of course I could change my POM to use simply <code>&lt;id&gt;local&lt;/id&gt;</code> to match the generated files, but I don't like to do things without understanding why I'm doing it. So maybe someone could tell me:</p>

<ul>
<li>Do I need the <code>maven-metadata-local.xml</code>? Does it serve a purpose?</li>
<li>Does the <code>local</code> part need to match the repository ID I use in the POM?</li>
<li>Does <code>mvn install:install-file</code> have a parameter to allow me to indicate the ID to use for the local repository (e.g. to generate <code>maven-metadata-local-repo.xml</code>, or must I manually rename the file afterwards?</li>
</ul>
