title: Why am I getting a "401 Unauthorized" error in Maven?
body: <p>Why am I getting a "401 Unauthorized" error in Maven?</p>
  
  <p>Here's the error I'm getting when calling <code>mvn deploy</code> (full logs at the bottom):</p>
  
  <p><code>[INFO] BUILD FAILURE</code><br>
  <code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project xbnjava: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized. -&gt; [Help 1]</code></p>
  
  <p>According to this <a href="https://issues.sonatype.org/browse/NEXUS-5073">sonatype support page</a>:</p>
  
  <blockquote>
    <p>"If you are receiving a 401 it is because maven is sending the wrong login credentials, or no credentials at all."</p>
  </blockquote>
  
  <p>Below are the steps I've taken, below that are my full <code>settings.xml</code> and <code>pom.xml</code> files, and below that are the full logs from <code>mvn deploy</code> and <code>mvn deploy -e</code>.</p>
  
  <p>Any ideas would be appreciated. I am just hitting wall after wall with Maven.</p>
  
  <hr>
  
  <p>I followed <a href="http://blog.sonatype.com/2010/11/what-to-do-when-nexus-returns-401/">sonatype's checklist</a> when receiving a 401 error:</p>
  
  <blockquote>
    <p><strong>Checklist item 1</strong>. <em>Make sure your username/password is correct by logging into the Nexus UI. If curl is installed on your machine, you can try deploying an artifact with...</em></p>
  </blockquote>
  
  <ul>
  <li>I successfully logged in and out of the sonatype.org website, using the user/pass in <code>settings.xml</code>.</li>
  <li>I <em>attempted</em> to use <code>curl</code> to manually deploy an artifact, with the command</li>
  </ul>
  
  <p><code>[C:\]curl -u MY_SONATYPE_DOT_COM_USERNAME:MY_SONATYPE_DOT_COM_PASSWORD https://oss.sonatype.org/content/repositories/snapshots/com/github/aliteralmind/xbnjava/0.1.2-SNAPSHOT/xbnjava-0.1.2-20140716.224928-1.pom --request PUT --data @pom.xml</code></p>
  
  <p>but got this error:</p>
  
  <pre><code>Warning: Couldn't read data from file "pom.xml", this makes an empty POST.
  curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
  error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
  More details here: http://curl.haxx.se/docs/sslcerts.html
  
  curl performs SSL certificate verification by default, using a "bundle"
   of Certificate Authority (CA) public keys (CA certs). If the default
   bundle file isn't adequate, you can specify an alternate file
   using the --cacert option.
  If this HTTPS server uses a certificate signed by a CA represented in
   the bundle, the certificate verification probably failed due to a
   problem with the certificate (it might be expired, or the name might
   not match the domain name in the URL).
  If you'd like to turn off curl's verification of the certificate, use
   the -k (or --insecure) option.
  </code></pre>
  
  <p>I ran it again with the <code>-k</code> option, and this time got only this:</p>
  
  <pre><code>Couldn't read data from file "pom.xml", this makes an empty POST.
  </code></pre>
  
  <p>I've never used curl before, so I'm at a loss on what to do with this information.</p>
  
  <blockquote>
    <p><strong>Checklist item 2</strong>. <em>If there is no error output, ensure your user privileges are correctly configured on the server.  Make sure to drop the repo you just created.</em></p>
  </blockquote>
  
  <p>I don't know what "drop" means. I believe my privileges are properly installed, as I received this message from sonatype:</p>
  
  <ul>
  <li>Configuration has been prepared, now you can:</li>
  <li>Deploy snapshot artifacts into repository <a href="https://oss.sonatype.org/content/repositories/snapshots">https://oss.sonatype.org/content/repositories/snapshots</a></li>
  <li>Deploy release artifacts into the staging repository <a href="https://oss.sonatype.org/service/local/staging/deploy/maven2">https://oss.sonatype.org/service/local/staging/deploy/maven2</a></li>
  <li>Promote staged artifacts into repository 'Releases'</li>
  <li>Download snapshot and release artifacts from group <a href="https://oss.sonatype.org/content/groups/public">https://oss.sonatype.org/content/groups/public</a></li>
  <li>Download snapshot, release and staged artifacts from staging group <a href="https://oss.sonatype.org/content/groups/staging">https://oss.sonatype.org/content/groups/staging</a></li>
  </ul>
  
  <p>and I <em>have</em> successfully put <a href="https://oss.sonatype.org/content/repositories/snapshots/com/github/aliteralmind/xbnjava/0.1.2-SNAPSHOT/">these items</a> onto the server via <code>mvn deploy</code> in the past couple days.</p>
  
  <p>The project's settings:</p>
  
  <p><img src="https://i.stack.imgur.com/O4Gz7.jpg" alt="project settings"></p>
  
  <blockquote>
    <p><strong>Checklist item 3</strong>. <em>Make sure you have configured a server in <code>settings.xml</code> and that the server id is identical to the distribution repository id in pom.xml.</em></p>
  </blockquote>
  
  <ul>
  <li>In <code>settings.xml</code>, settings/servers/server/id equals <code>ossrh</code></li>
  <li>In <code>pom.xml</code>, distributionManagement/snapshotRepository/id equals <code>ossrh</code></li>
  </ul>
  
  <p>(full files are at the bottom)</p>
  
  <blockquote>
    <p><strong>Checklist item 4</strong>. <em>Make sure your settings.xml is in the correct place (normally it’s _~/.m2/settings.xml).  You can check this by running mvn help:effective-settings.</em></p>
  </blockquote>
  
  <p>According to Maven's <a href="http://maven.apache.org/settings.html#Quick_Overview">settings reference</a>, settings.xml must be in one of two locations:</p>
  
  <ul>
  <li>The Maven install: <code>$M2_HOME/conf/settings.xml</code></li>
  <li>A user’s install: <code>${user.home}/.m2/settings.xml</code></li>
  </ul>
  
  <p>Here's my setup:</p>
  
  <ul>
  <li><code>settings.xml</code>: <code>C:\applications\programming\apache-maven-3.2.2\conf\settings.xml</code></li>
  <li><code>M2_HOME</code> is <code>C:\applications\programming\apache-maven-3.2.2</code></li>
  </ul>
  
  <p>Output for <code>mvn help:effective-settings</code>:</p>
  
  <pre><code>[C:\applications\utilities\curl]
  [INFO] Scanning for projects...
  [INFO]
  [INFO] ------------------------------------------------------------------------
  [INFO] Building Maven Stub Project (No POM) 1
  [INFO] ------------------------------------------------------------------------
  [INFO]
  [INFO] --- maven-help-plugin:2.2:effective-settings (default-cli) @ standalone-pom ---
  [INFO]
  Effective user-specific configuration settings:
  
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!-- ====================================================================== --&gt;
  &lt;!--                                                                        --&gt;
  &lt;!-- Generated by Maven Help Plugin on 2014-07-18T12:48:19                  --&gt;
  &lt;!-- See: http://maven.apache.org/plugins/maven-help-plugin/                --&gt;
  &lt;!--                                                                        --&gt;
  &lt;!-- ====================================================================== --&gt;
  
  &lt;!-- ====================================================================== --&gt;
  &lt;!--                                                                        --&gt;
  &lt;!-- Effective Settings for 'jeffy' on 'kermit-the-frog'                    --&gt;
  &lt;!--                                                                        --&gt;
  &lt;!-- ====================================================================== --&gt;
  
  &lt;settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:sc
  hemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"&gt;
    &lt;localRepository xmlns="http://maven.apache.org/SETTINGS/1.1.0"&gt;C:\Users\jeffy\.m2\repository&lt;/localRepository
  &gt;
    &lt;servers xmlns="http://maven.apache.org/SETTINGS/1.1.0"&gt;
      &lt;server&gt;
        &lt;username&gt;MY_SONATYPE_DOT_COM_USERNAME&lt;/username&gt;
        &lt;password&gt;***&lt;/password&gt;
        &lt;id&gt;ossrh&lt;/id&gt;
      &lt;/server&gt;
    &lt;/servers&gt;
    &lt;pluginGroups xmlns="http://maven.apache.org/SETTINGS/1.1.0"&gt;
      &lt;pluginGroup&gt;org.apache.maven.plugins&lt;/pluginGroup&gt;
      &lt;pluginGroup&gt;org.codehaus.mojo&lt;/pluginGroup&gt;
    &lt;/pluginGroups&gt;
  &lt;/settings&gt;
  
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 2.310 s
  [INFO] Finished at: 2014-07-18T12:48:19-04:00
  [INFO] Final Memory: 7M/17M
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <blockquote>
    <p><strong>Checklist item 5</strong>. <em>If the server is using https but the URL in your POM is http, you might get 401 as well.</em></p>
  </blockquote>
  
  <p>I don't understand which url it's referring to.</p>
  
  <blockquote>
    <p><strong>Checklist item 6</strong>. <em>Use the latest version of Maven, as there is a known issue regarding 401: MNG-4469</em></p>
  </blockquote>
  
  <p>I am using the latest version:</p>
  
  <pre><code>[C:\]mvn -version
  Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T09:51:42-04:00)
  Maven home: C:\applications\programming\apache-maven-3.2.2
  Java version: 1.7.0_51, vendor: Oracle Corporation
  Java home: C:\applications\programming\jdk_7_51\jre
  Default locale: en_US, platform encoding: Cp1252
  OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
  </code></pre>
  
  <h2>------------------</h2>
  
  <h2>Full <code>settings.xml</code> and <code>pom.xml</code> files</h2>
  
  <p>(Full logs for <code>mvn deploy</code> and <code>mvn deploy -e</code> below)</p>
  
  <p><code>settings.xml</code>:</p>
  
  <pre><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;servers&gt;
       &lt;server&gt;
         &lt;id&gt;ossrh&lt;/id&gt;
         &lt;username&gt;MY_SONATYPE_DOT_COM_USERNAME&lt;/username&gt;
         &lt;password&gt;MY_SONATYPE_DOT_COM_PASSWORD&lt;/password&gt;
       &lt;/server&gt;
     &lt;/servers&gt;
  
     &lt;pluginGroups&gt;&lt;/pluginGroups&gt;
     &lt;proxies&gt;&lt;/proxies&gt;
     &lt;mirrors&gt;&lt;/mirrors&gt;
     &lt;profiles&gt;&lt;/profiles&gt;
  &lt;/settings&gt;
  </code></pre>
  
  <p>pom.xml:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
     &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
     &lt;groupId&gt;com.github.aliteralmind&lt;/groupId&gt;
     &lt;artifactId&gt;xbnjava&lt;/artifactId&gt;
     &lt;packaging&gt;pom&lt;/packaging&gt;
     &lt;version&gt;0.1.2&lt;/version&gt;
     &lt;name&gt;XBN-Java&lt;/name&gt;
     &lt;url&gt;https://github.com/aliteralmind/xbnjava&lt;/url&gt;
     &lt;inceptionYear&gt;2014&lt;/inceptionYear&gt;
     &lt;organization&gt;
        &lt;name&gt;Jeff Epstein&lt;/name&gt;
     &lt;/organization&gt;
     &lt;description&gt;XBN-Java is a collection of generically-useful backend (server side, non-GUI) programming utilities, featuring RegexReplacer and FilteredLineIterator. XBN-Java is the foundation of Codelet (http://codelet.aliteralmind.com).&lt;/description&gt;
  
     &lt;parent&gt;
        &lt;groupId&gt;org.sonatype.oss&lt;/groupId&gt;
        &lt;artifactId&gt;oss-parent&lt;/artifactId&gt;
        &lt;version&gt;7&lt;/version&gt;
     &lt;/parent&gt;
  
     &lt;licenses&gt;
        &lt;license&gt;
           &lt;name&gt;Lesser General Public License (LGPL) version 3.0&lt;/name&gt;
           &lt;url&gt;https://www.gnu.org/licenses/lgpl-3.0.txt&lt;/url&gt;
        &lt;/license&gt;
        &lt;license&gt;
           &lt;name&gt;Apache Software License (ASL) version 2.0&lt;/name&gt;
           &lt;url&gt;http://www.apache.org/licenses/LICENSE-2.0.txt&lt;/url&gt;
        &lt;/license&gt;
     &lt;/licenses&gt;
  
     &lt;developers&gt;
        &lt;developer&gt;
           &lt;name&gt;Jeff Epstein&lt;/name&gt;
           &lt;email&gt;aliteralmind-github@yahoo.com&lt;/email&gt;
           &lt;roles&gt;
              &lt;role&gt;Lead Developer&lt;/role&gt;
           &lt;/roles&gt;
        &lt;/developer&gt;
     &lt;/developers&gt;
  
     &lt;issueManagement&gt;
        &lt;system&gt;GitHub Issue Tracker&lt;/system&gt;
        &lt;url&gt;https://github.com/aliteralmind/xbnjava/issues&lt;/url&gt;
     &lt;/issueManagement&gt;
  
     &lt;distributionManagement&gt;
        &lt;snapshotRepository&gt;
           &lt;id&gt;ossrh&lt;/id&gt;
           &lt;url&gt;https://oss.sonatype.org/content/repositories/snapshots&lt;/url&gt;
        &lt;/snapshotRepository&gt;
     &lt;/distributionManagement&gt;
  
     &lt;scm&gt;
        &lt;connection&gt;scm:git:git@github.com:aliteralmind/xbnjava.git&lt;/connection&gt;
        &lt;url&gt;scm:git:git@github.com:aliteralmind/xbnjava.git&lt;/url&gt;
        &lt;developerConnection&gt;scm:git:git@github.com:aliteralmind/xbnjava.git&lt;/developerConnection&gt;
     &lt;/scm&gt;
  
     &lt;properties&gt;
        &lt;java.version&gt;1.7&lt;/java.version&gt;
        &lt;jarprefix&gt;R:\jeffy\programming\build\/${project.artifactId}-${project.version}/download/${project.artifactId}-${project.version}&lt;/jarprefix&gt;
     &lt;/properties&gt;
  &lt;!--
    &lt;profiles&gt;
      &lt;profile&gt;
        &lt;id&gt;default-tools.jar&lt;/id&gt;
        &lt;activation&gt;
          &lt;property&gt;
            &lt;name&gt;java.vendor&lt;/name&gt;
            &lt;value&gt;Sun Microsystems Inc.&lt;/value&gt;
          &lt;/property&gt;
        &lt;/activation&gt;
        &lt;dependencies&gt;
          &lt;dependency&gt;
            &lt;groupId&gt;com.sun&lt;/groupId&gt;
            &lt;artifactId&gt;tools&lt;/artifactId&gt;
            &lt;version&gt;1.4.2&lt;/version&gt;
            &lt;scope&gt;system&lt;/scope&gt;
            &lt;systemPath&gt;${java.home}/../lib/tools.jar&lt;/systemPath&gt;
          &lt;/dependency&gt;
        &lt;/dependencies&gt;
      &lt;/profile&gt;
    &lt;/profiles&gt;
   --&gt;
     &lt;build&gt;
        &lt;plugins&gt;
           &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;build-helper-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.8&lt;/version&gt;
              &lt;executions&gt;
                 &lt;execution&gt;
                    &lt;id&gt;attach-artifacts&lt;/id&gt;
                    &lt;phase&gt;package&lt;/phase&gt;
                    &lt;goals&gt;
                       &lt;goal&gt;attach-artifact&lt;/goal&gt;
                    &lt;/goals&gt;
                    &lt;configuration&gt;
                       &lt;artifacts&gt;
                          &lt;artifact&gt;
                             &lt;file&gt;${jarprefix}-all.jar&lt;/file&gt;
                             &lt;type&gt;jar&lt;/type&gt;
                          &lt;/artifact&gt;
                       &lt;/artifacts&gt;
                    &lt;/configuration&gt;
                 &lt;/execution&gt;
              &lt;/executions&gt;
           &lt;/plugin&gt;
        &lt;/plugins&gt;
     &lt;/build&gt;
  
     &lt;profiles&gt;
        &lt;!--
        This profile will sign the JAR file, sources file, and javadocs file using the GPG key on the local machine.
        See: https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven
        --&gt;
        &lt;profile&gt;
           &lt;id&gt;release-sign-artifacts&lt;/id&gt;
           &lt;activation&gt;
              &lt;property&gt;
                 &lt;name&gt;release&lt;/name&gt;
                 &lt;value&gt;true&lt;/value&gt;
              &lt;/property&gt;
           &lt;/activation&gt;
        &lt;/profile&gt;
     &lt;/profiles&gt;
  &lt;/project&gt;
  </code></pre>
  
  <h2>------------------</h2>
  
  <h2>Full logs for <code>mvn deploy</code> and <code>mvn deploy -e</code></h2>
  
  <p><code>mvn deploy</code> output:</p>
  
  <pre><code>[INFO] Scanning for projects...
  [INFO] ------------------------------------------------------------------------
  [INFO] Building XBN-Java 0.1.2
  [INFO] ------------------------------------------------------------------------
  [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ xbnjava ---
  [INFO] --- build-helper-maven-plugin:1.8:attach-artifact (attach-artifacts) @ xbnjava ---
  [INFO] --- maven-install-plugin:2.4:install (default-install) @ xbnjava ---
  [INFO] Installing R:\jeffy\programming\sandbox\z__for_git_commit_only\xbnjava\pom.xml to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.2\xbnjava-0.1.2.pom
  [INFO] Installing R:\jeffy\programming\build\xbnjava-0.1.2\download\xbnjava-0.1.2-all.jar to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.2\xbnjava-0.1.2.jar
  [INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ xbnjava ---
  Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom
  2/6 KB
  4/6 KB
  6/6 KB
  </code></pre>
  
  <p>(Failure section:)</p>
  
  <pre><code>[INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 3.204 s
  [INFO] Finished at: 2014-07-18T11:25:17-04:00
  [INFO] Final Memory: 7M/17M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project xbnjava: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized. -&gt; [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] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>
  
  <p><code>mvn deploy -e</code> output:</p>
  
  <pre><code>[INFO] Error stacktraces are turned on.
  [INFO] Scanning for projects...
  [INFO] ------------------------------------------------------------------------
  [INFO] Building XBN-Java 0.1.2
  [INFO] ------------------------------------------------------------------------
  [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ xbnjava ---
  [INFO] --- build-helper-maven-plugin:1.8:attach-artifact (attach-artifacts) @ xbnjava ---
  [INFO] --- maven-install-plugin:2.4:install (default-install) @ xbnjava ---
  [INFO] Installing R:\jeffy\programming\sandbox\z__for_git_commit_only\xbnjava\pom.xml to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.2\xbnjava-0.1.2.pom
  [INFO] Installing R:\jeffy\programming\build\xbnjava-0.1.2\download\xbnjava-0.1.2-all.jar to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.2\xbnjava-0.1.2.jar
  [INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ xbnjava ---
  Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom
  2/6 KB
  4/6 KB
  6/6 KB
  </code></pre>
  
  <p>(Failure section:)</p>
  
  <pre><code>[INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 3.492 s
  [INFO] Finished at: 2014-07-18T11:25:37-04:00
  [INFO] Final Memory: 7M/17M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project xbnjava: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized. -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project xbnjava: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
     at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
     at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
     at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:606)
     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
     at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
     at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.
     at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:193)
     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
     ... 19 more
  Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.
     at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:143)
     at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:167)
     at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:149)
     ... 21 more
  Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.
     at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:337)
     at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:268)
     at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:413)
     at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:139)
     ... 23 more
  Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.
     at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$6.wrap(WagonRepositoryConnector.java:1016)
     at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$6.wrap(WagonRepositoryConnector.java:1004)
     at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:895)
     at org.eclipse.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:522)
     at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:331)
     ... 26 more
  Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.
     at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:573)
     at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:493)
     at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:474)
     at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:454)
     at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:871)
     ... 28 more
  [ERROR]
  [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] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>