title: Maven Settings for multiple repositories
body: <p>I have the following in settings.xml</p>
  
  
  
  <pre class="lang-xml prettyprint-override"><code>&lt;mirrors&gt;
         &lt;mirror&gt;
            &lt;id&gt;paid-jars&lt;/id&gt;
            &lt;name&gt;jars with license&lt;/name&gt;
            &lt;url&gt;http://url:8081/nexus/content/repositories/paidjars/&lt;/url&gt;
            &lt;mirrorOf&gt;!central&lt;/mirrorOf&gt;
        &lt;/mirror&gt;
        &lt;mirror&gt;
            &lt;id&gt;Org-central&lt;/id&gt;
            &lt;name&gt;mirror of central&lt;/name&gt;
            &lt;url&gt;http://url:8081/nexus/content/repositories/central/&lt;/url&gt;
            &lt;mirrorOf&gt;central&lt;/mirrorOf&gt;
        &lt;/mirror&gt;
    &lt;/mirrors&gt;
  </code></pre>
  
  <p>In pom.xml I have two jars </p>
  
  <ol>
  <li>apache-commons.jar (which I assumes to be downloaded from central)</li>
  <li>licensed.jar (which I assume to be downloaded from paid-jars)</li>
  </ol>
  
  <p>But when I run <code>maven clean install</code> it tries to download licensed.jar from Org-central.</p>
  
  <p>How can I make it use paid-jars to download? Is it possible first it goes to Org-central and if fails it tries at paid-jars? If so, how? I don't want to put repo entries in pom.xml</p>
  
  <hr>
  
  <p><strong>Settings.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;    
  &lt;settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                   http://maven.apache.org/xsd/settings-1.0.0.xsd"&gt;
    &lt;proxies&gt;    
      &lt;proxy&gt;
        &lt;id&gt;Proxy&lt;/id&gt;
        &lt;active&gt;true&lt;/active&gt;
        &lt;protocol&gt;http&lt;/protocol&gt;
        &lt;username&gt;username&lt;/username&gt;
        &lt;password&gt;******&lt;/password&gt;
        &lt;host&gt;host.url&lt;/host&gt;
        &lt;port&gt;8080&lt;/port&gt;
        &lt;nonProxyHosts&gt;local.net|internal.com&lt;/nonProxyHosts&gt;
      &lt;/proxy&gt;
    &lt;/proxies&gt;
   &lt;mirrors&gt;
         &lt;mirror&gt;
            &lt;id&gt;paid-jars&lt;/id&gt;
            &lt;name&gt;jars with license&lt;/name&gt;
            &lt;url&gt;http://url:8081/nexus/content/repositories/paidjars/&lt;/url&gt;
            &lt;mirrorOf&gt;!central&lt;/mirrorOf&gt;
        &lt;/mirror&gt;
        &lt;mirror&gt;
            &lt;id&gt;Org-central&lt;/id&gt;
            &lt;name&gt;mirror of central&lt;/name&gt;
            &lt;url&gt;http://url:8081/nexus/content/repositories/central/&lt;/url&gt;
            &lt;mirrorOf&gt;central&lt;/mirrorOf&gt;
        &lt;/mirror&gt;
    &lt;/mirrors&gt;
    &lt;profiles&gt;
        &lt;profile&gt;
            &lt;id&gt;compiler&lt;/id&gt;
            &lt;properties&gt;
                &lt;JAVA_1_7_HOME&gt;C:\Program Files (x86)\Java\jdk1.7.0_51\bin&lt;/JAVA_1_7_HOME&gt;
            &lt;/properties&gt;
        &lt;/profile&gt;
    &lt;/profiles&gt;
  &lt;/settings&gt;
  </code></pre>