title: Return Code 401 with Maven 3 uploading SNAPSHOT to Artifactory
body: <p>I am running the following:</p>
  
  <p>Apache Maven 3.0.5, Artifactory(Open-Source) 3.1.0</p>
  
  <p>No Jenkins/Hudson, just the default Artifactory setup.</p>
  
  <p>Excerpt from pom.xml:</p>
  
  <pre><code>&lt;distributionManagement&gt;
      &lt;repository&gt;
      &lt;id&gt;ServerA2&lt;/id&gt;
      &lt;name&gt;ServerA2-releases&lt;/name&gt;
      &lt;url&gt;http://192.168.1.16:8081/artifactory/libs-release-local&lt;/url&gt;
      &lt;/repository&gt;
      &lt;snapshotRepository&gt;
      &lt;id&gt;ServerA2&lt;/id&gt;
      &lt;name&gt;ServerA2-snapshots&lt;/name&gt;
      &lt;url&gt;http://192.168.1.16:8081/artifactory/libs-snapshot-local&lt;/url&gt;
      &lt;/snapshotRepository&gt;
  &lt;/distributionManagement&gt;
  </code></pre>
  
  <p>Excerpt from settings.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
    &lt;servers&gt;
      &lt;server&gt;
        &lt;username&gt;admin&lt;/username&gt;
        &lt;password&gt;XXX&lt;/password&gt;
        &lt;id&gt;central&lt;/id&gt;
      &lt;/server&gt;
      &lt;server&gt;
        &lt;username&gt;admin&lt;/username&gt;
        &lt;password&gt;XXX&lt;/password&gt;
        &lt;id&gt;snapshots&lt;/id&gt;
      &lt;/server&gt;
      &lt;server&gt;
        &lt;username&gt;admin&lt;/username&gt;
        &lt;password&gt;XXX&lt;/password&gt;
        &lt;id&gt;ServerA2&lt;/id&gt;
      &lt;/server&gt;
    &lt;/servers&gt;
    &lt;profiles&gt;
      &lt;profile&gt;
        &lt;repositories&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;libs-release&lt;/name&gt;
            &lt;url&gt;http://192.168.1.16:8081/artifactory/libs-release&lt;/url&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
            &lt;snapshots /&gt;
            &lt;id&gt;snapshots&lt;/id&gt;
            &lt;name&gt;libs-snapshot&lt;/name&gt;
            &lt;url&gt;http://192.168.1.16:8081/artifactory/libs-snapshot&lt;/url&gt;
          &lt;/repository&gt;
        &lt;/repositories&gt;
        &lt;pluginRepositories&gt;
          &lt;pluginRepository&gt;
            &lt;snapshots&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
            &lt;/snapshots&gt;
            &lt;id&gt;central&lt;/id&gt;
            &lt;name&gt;plugins-release&lt;/name&gt;
            &lt;url&gt;http://192.168.1.16:8081/artifactory/plugins-release&lt;/url&gt;
          &lt;/pluginRepository&gt;
          &lt;pluginRepository&gt;
            &lt;snapshots /&gt;
            &lt;id&gt;snapshots&lt;/id&gt;
            &lt;name&gt;plugins-snapshot&lt;/name&gt;
            &lt;url&gt;http://192.168.1.16:8081/artifactory/plugins-snapshot&lt;/url&gt;
          &lt;/pluginRepository&gt;
        &lt;/pluginRepositories&gt;
        &lt;id&gt;artifactory&lt;/id&gt;
      &lt;/profile&gt;
    &lt;/profiles&gt;
    &lt;activeProfiles&gt;
      &lt;activeProfile&gt;artifactory&lt;/activeProfile&gt;
    &lt;/activeProfiles&gt;
  &lt;/settings&gt;
  </code></pre>
  
  <p>Now to the problem:</p>
  
  <p>I have no problems doing <code>mvn deploy</code> when I set the version in pom.xml to <code>&lt;version&gt;1.0&lt;/version&gt;</code>. The Artifact was uploaded successfully</p>
  
  <p>But I encounter the following error when I set the version in pom.xml to <code>&lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;</code></p>
  
  <p>Output from <code>mvn clean deploy -X -e</code></p>
  
  <pre><code>[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ pinder ---
  [DEBUG] org.apache.maven.plugins:maven-deploy-plugin:jar:2.7:
  [DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.6:compile
  [DEBUG]    org.apache.maven:maven-project:jar:2.0.6:compile
  [DEBUG]       org.apache.maven:maven-settings:jar:2.0.6:compile
  [DEBUG]       org.apache.maven:maven-profile:jar:2.0.6:compile
  [DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.0.6:compile
  [DEBUG]          org.apache.maven:maven-repository-metadata:jar:2.0.6:compile
  [DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.0.6:compile
  [DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
  [DEBUG]          junit:junit:jar:3.8.1:compile
  [DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
  [DEBUG]    org.apache.maven:maven-model:jar:2.0.6:compile
  [DEBUG]    org.apache.maven:maven-artifact:jar:2.0.6:compile
  [DEBUG]    org.codehaus.plexus:plexus-utils:jar:1.5.6:compile
  [DEBUG] Created new class realm plugin&gt;org.apache.maven.plugins:maven-deploy-plugin:2.7
  [DEBUG] Importing foreign packages into class realm plugin&gt;org.apache.maven.plugins:maven-deploy-plugin:2.7
  [DEBUG]   Imported:  &lt; project&gt;sg.com.pinder:pinder:0.0.1-SNAPSHOT
  [DEBUG] Populating class realm plugin&gt;org.apache.maven.plugins:maven-deploy-plugin:2.7
  [DEBUG]   Included: org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
  [DEBUG]   Included: junit:junit:jar:3.8.1
  [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.5.6
  [DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0.6
  [DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0.6
  [DEBUG]   Excluded: org.apache.maven:maven-settings:jar:2.0.6
  [DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0.6
  [DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.6
  [DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.6
  [DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.6
  [DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
  [DEBUG]   Excluded: classworlds:classworlds:jar:1.1-alpha-2
  [DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0.6
  [DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0.6
  [DEBUG] Configuring mojo org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy from plugin realm ClassRealm[plugin&gt;org.apache.maven.plugins:maven-deploy-plugin:2.7, parent: sun.misc.Launcher$AppClassLoader@645ad7b2]
  [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy' with basic configurator --&gt;
  [DEBUG]   (f) artifact = sg.com.pinder:pinder:jar:0.0.1-SNAPSHOT
  [DEBUG]   (f) attachedArtifacts = []
  [DEBUG]   (s) localRepository =        id: local
        url: file:///home/Eric_Vader/.m2/repository/
     layout: none
  
  [DEBUG]   (f) offline = false
  [DEBUG]   (f) packaging = jar
  [DEBUG]   (f) pomFile = /home/Eric_Vader/workspace/pinder/pom.xml
  [DEBUG]   (f) project = MavenProject: sg.com.pinder:pinder:0.0.1-SNAPSHOT @ /home/Eric_Vader/workspace/pinder/pom.xml
  [DEBUG]   (f) retryFailedDeploymentCount = 1
  [DEBUG]   (f) skip = false
  [DEBUG]   (f) updateReleaseInfo = false
  [DEBUG] -- end configuration --
  [DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://192.168.1.16:8081/artifactory/libs-snapshot-local as admin
  Downloading: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/maven-metadata.xml
  [DEBUG] Could not find metadata sg.com.pinder:pinder:0.0.1-SNAPSHOT/maven-metadata.xml in ServerA2 (http://192.168.1.16:8081/artifactory/libs-snapshot-local)
  [DEBUG] Writing resolution tracking file /home/Eric_Vader/.m2/repository/sg/com/pinder/pinder/0.0.1-SNAPSHOT/resolver-status.properties
  Uploading: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar
  Uploading: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.pom
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 3.000s
  [INFO] Finished at: Fri Dec 27 16:48:15 SGT 2013
  [INFO] Final Memory: 18M/216M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project pinder: Failed to deploy artifacts: Could not transfer artifact sg.com.pinder:pinder:jar:0.0.1-20131227.084815-1 from/to ServerA2 (http://192.168.1.16:8081/artifactory/libs-snapshot-local): Failed to transfer file: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar. Return code is: 401 -&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 pinder: Failed to deploy artifacts: Could not transfer artifact sg.com.pinder:pinder:jar:0.0.1-20131227.084815-1 from/to ServerA2 (http://192.168.1.16:8081/artifactory/libs-snapshot-local): Failed to transfer file: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar. Return code is: 401
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
      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:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      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:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)
  Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to deploy artifacts: Could not transfer artifact sg.com.pinder:pinder:jar:0.0.1-20131227.084815-1 from/to ServerA2 (http://192.168.1.16:8081/artifactory/libs-snapshot-local): Failed to transfer file: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar. Return code is: 401
      at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:193)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      ... 19 more
  Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact sg.com.pinder:pinder:jar:0.0.1-20131227.084815-1 from/to ServerA2 (http://192.168.1.16:8081/artifactory/libs-snapshot-local): Failed to transfer file: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar. Return code is: 401
      at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141)
      at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:167)
      at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:157)
      ... 21 more
  Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact sg.com.pinder:pinder:jar:0.0.1-20131227.084815-1 from/to ServerA2 (http://192.168.1.16:8081/artifactory/libs-snapshot-local): Failed to transfer file: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar. Return code is: 401
      at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:280)
      at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:211)
      at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:443)
      at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137)
      ... 23 more
  Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact sg.com.pinder:pinder:jar:0.0.1-20131227.084815-1 from/to ServerA2 (http://192.168.1.16:8081/artifactory/libs-snapshot-local): Failed to transfer file: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar. Return code is: 401
      at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:951)
      at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:939)
      at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:837)
      at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:467)
      at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:274)
      ... 26 more
  Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar. Return code is: 401
      at org.apache.maven.wagon.providers.http.LightweightHttpWagon.finishPutTransfer(LightweightHttpWagon.java:257)
      at org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:423)
      at org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:402)
      at org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:376)
      at org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:163)
      at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:811)
      ... 28 more
  [ERROR] 
  [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>Excerpt from access.log:</p>
  
  <pre><code>2013-12-27 16:48:15,328 [DENIED DEPLOY] libs-snapshot-local:sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar for anonymous/192.168.1.164.
  2013-12-27 16:48:15,335 [DENIED DEPLOY] libs-snapshot-local:sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.pom for anonymous/192.168.1.164.
  </code></pre>
  
  <p>I tried most of the things suggested by other similar questions like:
  trying setting the <code>Maven Snapshot Version Behavior</code> setting, <code>snapshot</code> tag in settings.xml.</p>
  
  <p>One thing to note is that the log on the Artifactory server does not log anything when the error occur. </p>