title: Maven - <server/> in settings.xml
body: <p>I use tomcat-maven-plugin to deploy my war to a server. What I have to do is configure it like this in my pom.xml:</p>
  
  
  
  <pre class="lang-xml prettyprint-override"><code>&lt;configuration&gt;
  ...
     &lt;url&gt;http://localhost/manager&lt;/url&gt;
     &lt;username&gt;admin&lt;/username&gt;
     &lt;password&gt;admin&lt;/password&gt;
  ...
  &lt;/configuration&gt;
  </code></pre>
  
  <p>But then I obviously want to keep this settings in a different place since I work on my computer but then there's a staging and a live server as well where the settings of the server are different.</p>
  
  <p>So let's use the <code>.m2/settings.xml</code>:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;servers&gt;
      &lt;server&gt;
          &lt;id&gt;local_tomcat&lt;/id&gt;
          &lt;username&gt;admin&lt;/username&gt;
          &lt;password&gt;admin&lt;/password&gt;
      &lt;/server&gt;
  &lt;/servers&gt;
  </code></pre>
  
  <p>Now change the pom.xml:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;configuration&gt;
      &lt;server&gt;local_tomcat&lt;/server&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>But where to put the URL of the server? There's no place for that in the settings.xml under the server tag! Maybe like this?</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;profiles&gt;
    &lt;profile&gt;
       &lt;id&gt;tomcat-config&lt;/id&gt;
        &lt;properties&gt;
      &lt;tomcat.url&gt;http://localhost/manager&lt;/tomcat.url&gt;
        &lt;/properties&gt;
    &lt;/profile&gt;
  &lt;/profiles&gt;
  
  &lt;activeProfiles&gt;
     &lt;activeProfile&gt;tomcat-config&lt;/activeProfile&gt;
  &lt;/activeProfiles&gt;
  </code></pre>
  
  <p>..and use the ${tomcat.url} property. </p>
  
  <p>But then the question is, why use the server tag in <code>settings.xml</code> at all? Why not use properties for the username and password as well? Or is there a place for the URL as well in the settings URL so I don't have to use properties?</p>