title: Sonatype Nexus gives 401 for some unkown reason
body: <p>We have to work with Nexus OSS version 3.20.1-01. We have a problem with it when we try to deploy or push an Maven2 artifact(jar) to Nexus. We used a account test123 with password test123. test123 has privlidges  nx-admin  in nexus.  If we try to login in the admin console we can do this without any problem.</p>
  
  <p>But if we try to refer to a proxy server configured on Nexus with name  sligro-proxy  then for some reason its sends the 401. </p>
  
  <p>We use Maven 3.5.4</p>
  
  <p>But for some silly reason we can't use the proxy sligro-proxy  to maven central.  If we use Maven without Nexus by deleting the settings.xml file then this build goes fine.   ./mvn  package.</p>
  
  <p>If I change something in the settings.xml file then I see the build is responding on that change.</p>
  
  <p>We see the 401 in the request.log of Nexus like this:</p>
  
  <pre><code>192.168.178.123 - - [16/Feb/2020:19:46:50 +0100] "HEAD /nexus/repository/sligro-proxy/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom HTTP/1.1" 401 - 0 2 "Apache-Maven/3.5.4 (Java 1.8.0_112; Linux 3.10.0-957.27.2.el7.x86_64)" [qtp1998317514-191]    
  </code></pre>
  
  <p>And on the client we see this:
      [INFO] Finished at: 2020-02-16T19:46:50+01:00
  [INFO] ------------------------------------------------------------------------
  [ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to nexus (<a href="http://192.168.178.178:8081/nexus/repository/sligro-proxy" rel="nofollow noreferrer">http://192.168.178.178:8081/nexus/repository/sligro-proxy</a>): Not authorized , ReasonPhrase: Unauthorized. -> [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] <a href="http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException" rel="nofollow noreferrer">http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException</a>    </p>
  
  <p>This is my settings.xml file:</p>
  
  <pre><code>    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.example&lt;/groupId&gt;
      &lt;artifactId&gt;nexus-proxy&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.10&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;distributionManagement&gt;
          &lt;repository&gt;
              &lt;id&gt;sligro&lt;/id&gt;
              &lt;name&gt;maven-releases&lt;/name&gt;
              &lt;url&gt;http://192.168.178.178:8081/nexus/repository/maven-releases/&lt;/url&gt;
          &lt;/repository&gt;
          &lt;snapshotRepository&gt;
              &lt;id&gt;sligro&lt;/id&gt;
              &lt;name&gt;maven-snapshots&lt;/name&gt;
              &lt;url&gt;http://192.168.178.178:8081/nexus/repository/maven-snapshots/&lt;/url&gt;
          &lt;/snapshotRepository&gt;
      &lt;/distributionManagement&gt;```
  
  This is my settings.xml file:
  
      &lt;/project&gt;This is my settings file:&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;servers&gt;
          &lt;server&gt;
              &lt;id&gt;nexus-snapshots&lt;/id&gt;
              &lt;username&gt;test123&lt;/username&gt;
              &lt;password&gt;test123&lt;/password&gt;
          &lt;/server&gt;
          &lt;server&gt;
              &lt;id&gt;nexus-releases&lt;/id&gt;
              &lt;username&gt;test123&lt;/username&gt;
              &lt;password&gt;test123&lt;/password&gt;
          &lt;/server&gt;
          &lt;server&gt;
              &lt;id&gt;sligro&lt;/id&gt;
              &lt;username&gt;test123&lt;/username&gt;
              &lt;password&gt;test123&lt;/password&gt;
          &lt;/server&gt;
          &lt;server&gt;
              &lt;id&gt;sligro-proxy&lt;/id&gt;
              &lt;username&gt;test123&lt;/username&gt;
              &lt;password&gt;test123&lt;/password&gt;
          &lt;/server&gt;
          &lt;server&gt;
              &lt;id&gt;/192.168.178.178:8081&lt;/id&gt;
              &lt;username&gt;test123&lt;/username&gt;
              &lt;password&gt;test123&lt;/password&gt;
          &lt;/server&gt;
      &lt;/servers&gt;
      &lt;mirrors&gt;
          &lt;mirror&gt;
              &lt;id&gt;nexus&lt;/id&gt;
              &lt;mirrorOf&gt;*&lt;/mirrorOf&gt;
              &lt;url&gt;http://192.168.178.178:8081/nexus/repository/sligro-proxy&lt;/url&gt;
          &lt;/mirror&gt;
      &lt;/mirrors&gt;
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;sligro&lt;/id&gt;
              &lt;repositories&gt;
                  &lt;repository&gt;
                      &lt;id&gt;central&lt;/id&gt;
                      &lt;url&gt;http://central&lt;/url&gt;
                      &lt;releases&gt;
                          &lt;enabled&gt;true&lt;/enabled&gt;
                      &lt;/releases&gt;
                      &lt;snapshots&gt;
                          &lt;enabled&gt;true&lt;/enabled&gt;
                      &lt;/snapshots&gt;
                  &lt;/repository&gt;
              &lt;/repositories&gt;
              &lt;pluginRepositories&gt;
                  &lt;pluginRepository&gt;
                      &lt;id&gt;central&lt;/id&gt;
                      &lt;url&gt;http://central&lt;/url&gt;
                      &lt;releases&gt;
                          &lt;enabled&gt;true&lt;/enabled&gt;
                      &lt;/releases&gt;
                      &lt;snapshots&gt;
                          &lt;enabled&gt;true&lt;/enabled&gt;
                      &lt;/snapshots&gt;
                  &lt;/pluginRepository&gt;
              &lt;/pluginRepositories&gt;
              &lt;properties&gt;
                  &lt;nexus.url&gt;http://192.168.178.178:8081/nexus/repository&lt;/nexus.url&gt;
              &lt;/properties&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
      &lt;activeProfiles&gt;
          &lt;activeProfile&gt;sligro&lt;/activeProfile&gt;
      &lt;/activeProfiles&gt;
  &lt;/settings&gt;    
  
  
  
  Well I almost spend to 2 days this weekend to find out what the problem is and 
  changed tons of params but it gives always the 401. Help would be appriciated. 
  Thanks
  </code></pre>