title: Maven artifact cannot be resolved; attempting to resolve artifact from the wrong repository
body: <p>After upgrading a dependency in my pom.xml, I received the following error when attempting to download the new artifact (Using maven command line <code>mvn spring-boot:run</code> in this case).</p>
  
  <blockquote>
    <p>The following artifacts could not be resolved:
    io.github.bonigarcia:webdrivermanager:jar:3.8.1,
    org.zaproxy:zap-clientapi:jar:1.7.0: Could not find artifact
    io.github.bonigarcia:webdrivermanager:jar:3.8.1 in spring-milestone
    (<a href="https://repo.spring.io/milestone" rel="nofollow noreferrer">https://repo.spring.io/milestone</a>)</p>
  </blockquote>
  
  <p>The error message is correct, that artifact does not exist in <a href="https://repo.spring.io/milestone" rel="nofollow noreferrer">https://repo.spring.io/milestone</a>. It does exists in Maven central (<a href="https://repo.maven.apache.org/maven2" rel="nofollow noreferrer">https://repo.maven.apache.org/maven2</a>), so why would Maven be looking for the artifact in the wrong repository?</p>
  
  <p>I do know that this is tied to my Maven settings (settings.xml) where I define a mirror to our internal Nexus repository. When I remove the mirror, Maven successfully looks for and finds the artifact in Maven central.  What I don't understand is the mechanics of how things work when an artifact does not exist in Nexus, and why this mirror setting changes how an artifact is discovered for the first time.</p>
  
  <p>From settings.xml..</p>
  
  <pre><code>&lt;mirrors&gt;
      &lt;mirror&gt;
          &lt;id&gt;Nexus&lt;/id&gt;
          &lt;name&gt;Nexus Public Mirror&lt;/name&gt;
          &lt;url&gt;https://myinternalnexushost.net/nexus/content/repositories/central&lt;/url&gt;
          &lt;mirrorOf&gt;central&lt;/mirrorOf&gt;
      &lt;/mirror&gt;
  &lt;/mirrors&gt;
  </code></pre>
  
  <p>It's also noteworthy that this is a Spring Boot project.  I don't define any repositories in my pom.xml, but since I'm specifying a spring boot parent pom I'm inheriting the following repositories:</p>
  
  <p>From Spring Boot parent pom</p>
  
  <pre><code>  &lt;repositories&gt;
      &lt;repository&gt;
        &lt;snapshots&gt;
          &lt;enabled&gt;false&lt;/enabled&gt;
        &lt;/snapshots&gt;
        &lt;id&gt;spring-milestone&lt;/id&gt;
        &lt;name&gt;Spring Milestone&lt;/name&gt;
        &lt;url&gt;https://repo.spring.io/milestone&lt;/url&gt;
      &lt;/repository&gt;
      &lt;repository&gt;
        &lt;snapshots&gt;
          &lt;enabled&gt;true&lt;/enabled&gt;
        &lt;/snapshots&gt;
        &lt;id&gt;spring-snapshot&lt;/id&gt;
        &lt;name&gt;Spring Snapshot&lt;/name&gt;
        &lt;url&gt;https://repo.spring.io/snapshot&lt;/url&gt;
      &lt;/repository&gt;
      &lt;repository&gt;
        &lt;snapshots&gt;
          &lt;enabled&gt;false&lt;/enabled&gt;
        &lt;/snapshots&gt;
        &lt;id&gt;rabbit-milestone&lt;/id&gt;
        &lt;name&gt;Rabbit Milestone&lt;/name&gt;
        &lt;url&gt;https://dl.bintray.com/rabbitmq/maven-milestones&lt;/url&gt;
      &lt;/repository&gt;
      &lt;repository&gt;
        &lt;snapshots&gt;
          &lt;enabled&gt;false&lt;/enabled&gt;
        &lt;/snapshots&gt;
        &lt;id&gt;central&lt;/id&gt;
        &lt;name&gt;Central Repository&lt;/name&gt;
        &lt;url&gt;https://repo.maven.apache.org/maven2&lt;/url&gt;
      &lt;/repository&gt;
    &lt;/repositories&gt;
  </code></pre>