title: Maven does not reference the settings.xml for a repository when deploying
body: <p>I am trying to configure the <code>deploy</code> step in a Maven 3.0.4 POM using the <a href="http://maven.apache.org/pom.html#Distribution_Management" rel="nofollow"><code>&lt;distributionManagement&gt;</code> </a> tag. From <a href="http://maven.apache.org/xsd/maven-4.0.0.xsd" rel="nofollow">XSD for POMs (line 1389)</a>, it suggests that merely providing the <code>id</code> should allow Maven too look up the corresponding values from the <code>settings.xml</code> file. I have the desired server listed (which is configured correctly since I can pull dependencies from it and see it mentioned when running in <code>-X</code> debug mode: <code>[DEBUG] Repositories (dependencies): [archiva.snapshots (http://snap-mvnrepo.initech.com/archiva/repository/snapshots, releases+snapshots)]</code>) in the <code>settings.xml</code>. However, when I just provide the <code>&lt;id&gt;</code> in my POM and try to <code>deploy</code>, I get an error that Maven is missing the URL for the repository, but when I explicitly provide the <code>&lt;url&gt;</code> the <code>deploy</code> works.</p>
  
  <p>Does anyone know what I should do to get it working by id only? I don't want to hard code the URL.</p>
  
  <hr>
  
  <p><strong>DISCLAIMERS:</strong> Typos are likely the result of anonymization, but it is possible that they are "real" so feel free to point away at any.</p>
  
  <p>About the <code>&lt;id&gt;</code> child tag of <code>&lt;repository&gt;</code> from the <a href="http://maven.apache.org/xsd/maven-4.0.0.xsd" rel="nofollow">XSD for POMs (line 1389)</a>:</p>
  
  <blockquote>
    <p>A unique identifier for a repository. This is used to match the repository to configuration in the <code>settings.xml</code> file, for example.</p>
  </blockquote>
  
  <p>From my <code>settings.xml</code>:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;profile&gt;
      &lt;id&gt;archiva_dev&lt;/id&gt;
      &lt;activation&gt;
          &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
      &lt;/activation&gt;
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;archiva.snapshots&lt;/id&gt;
              &lt;name&gt;Initech Internal Snapshot Repository&lt;/name&gt;
              &lt;url&gt;http://snap-mvnrepo.initech.com/archiva/repository/snapshots&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  &lt;/profile&gt;
  </code></pre>
  
  <p>From my (failing) <code>pom.xml</code>:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;distributionManagement&gt;
      &lt;repository&gt;
          &lt;id&gt;archiva.snapshots&lt;/id&gt;
      &lt;!--
          &lt;name&gt;Initech Internal Snapshot Repository&lt;/name&gt;
          &lt;url&gt;http://snap-mvnrepo.initech.com/archiva/repository/snapshots&lt;/url&gt;
      --&gt;         
      &lt;/repository&gt;
  &lt;/distributionManagement&gt;
  </code></pre>
  
  <p>The error: </p>
  
  <pre><code>Caused by: java.lang.IllegalStateException: Failed to create release distribution repository for com.initech.ws:initechws:pom:1.0-SNAPSHOT
          at org.apache.maven.project.MavenProject.getReleaseArtifactRepository(MavenProject.java:1853)
          at org.apache.maven.project.MavenProject.getDistributionManagementArtifactRepository(MavenProject.java:1377)
          at org.apache.maven.plugin.deploy.DeployMojo.getDeploymentRepository(DeployMojo.java:227)
          at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:118)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
          ... 20 more
  Caused by: org.apache.maven.artifact.InvalidRepositoryException: URL missing for repository archiva.snapshots
          at org.apache.maven.repository.legacy.LegacyRepositorySystem.buildArtifactRepository(LegacyRepositorySystem.java:775)
          at org.apache.maven.project.MavenProject.getReleaseArtifactRepository(MavenProject.java:1843)
          ... 24 more
  </code></pre>