title: repositories vs pluginRepositories in maven settings.xml
body: <p>I have the below settings.xml file in my <strong>~/.m2/</strong> folder:</p>
  
  <pre><code>&lt;settings&gt;
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;my-repositories&lt;/id&gt;
              &lt;repositories&gt;
                  &lt;repository&gt;
                      &lt;id&gt;thirdparty-repository&lt;/id&gt;
                      &lt;name&gt;Thirdparty repository&lt;/name&gt;
                      &lt;url&gt;https://mynexus/repository/thirdparty/&lt;/url&gt;
                  &lt;/repository&gt;
              &lt;/repositories&gt;
              &lt;pluginRepositories&gt;
                  &lt;pluginRepository&gt;
                      &lt;id&gt;thirdparty-plugin-repository&lt;/id&gt;
                      &lt;name&gt;Thirdparty plugin repository&lt;/name&gt;
                      &lt;url&gt;https://mynexus/repository/thirdparty/&lt;/url&gt;
                  &lt;/pluginRepository&gt;
              &lt;/pluginRepositories&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
      &lt;activeProfiles&gt;
          &lt;activeProfile&gt;my-repositories&lt;/activeProfile&gt;
      &lt;/activeProfiles&gt;
  &lt;/settings&gt;
  </code></pre>
  
  <p>For both repositories the same nexus group repository is used:</p>
  
  <p><a href="https://mynexus/repository/thirdparty/" rel="nofollow noreferrer">https://mynexus/repository/thirdparty/</a></p>
  
  <p>If I remove the first one: <code>thirdparty-repository</code> I get the below error:</p>
  
  <pre><code>Failed to read artifact descriptor for junit:junit:jar:4.8.2: Could not transfer artifact junit:junit:pom:4.8.2 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
  </code></pre>
  
  <p>Now If I re-enable it and instead remove the other one: <code>thirdparty-plugin-repository</code> I now get this error:</p>
  
  <pre><code> Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
  </code></pre>
  
  <p>Only when I have them both enabled at the same time it works.</p>
  
  <p>Why do I need both <code>repositories</code> and <code>pluginRepositories</code> that points to the same nexus repository?</p>