title: Why can't I deploy from my local repository to a remote Maven repository?
body: <p>I'm using Maven 3.0.4 and want to deploy something in my local repository to a remote repository, to which I've verified I have access.  I'm using the below command …</p>
  
  <pre><code>mvn -X deploy:deploy-file -DgroupId=org.directwebremoting -DartifactId=dwr  -Dversion=3.0.0-rc2 -Dpackaging=jar -Dfile=/Users/davea/.m2/repository//org/directwebremoting/dwr/3.0.0-rc2/dwr-3.0.0-rc2.jar  -Durl=dav:https://repository-myco.forge.cloudbees.com/private  -DrepositoryId=cloudbees-private
  </code></pre>
  
  <p>but am getting this unhelpful error message.  Any ideas what else I should check?  Following the error is my ~.m2/settings.xml file.</p>
  
  <pre><code>Apache Maven 3.0.4 (r1232337; 2012-01-17 02:44:56-0600) 
  Maven home: /opt/apache-maven-3.0.4 
  Java version: 1.6.0_37, vendor: Apple Inc.  
  Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home 
  Default locale: en_US, platform encoding: MacRoman  
  OS name: "mac os x", version: "10.7.5", arch: "x86_64", family: "mac"   
  [INFO] Error stacktraces are turned on. 
  [DEBUG] Reading global settings from /opt/apache-maven-3.0.4/conf/settings.xml  
  [DEBUG] Reading user settings from /Users/davea/.m2/settings.xml    
  [DEBUG] Using local repository at /Users/davea/.m2/repository   
  [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /Users/davea/.m2/repository   
  [INFO] Scanning for projects... 
  [DEBUG] Extension realms for project org.mainco.subco:myproject:war:1.0-SNAPSHOT: (none)    
  [DEBUG] Looking up lifecyle mappings for packaging war from ClassRealm[plexus.core, parent: null]   
  [DEBUG] Resolving plugin prefix deploy from [org.apache.maven.plugins, org.codehaus.mojo]   
  [DEBUG] Resolved plugin prefix deploy to org.apache.maven.plugins:maven-deploy-plugin from POM org.mainco.subco:myproject:war:1.0-SNAPSHOT  
  [DEBUG] === REACTOR BUILD PLAN ================================================ 
  [DEBUG] Project: org.mainco.subco:myproject:war:1.0-SNAPSHOT    
  [DEBUG] Tasks:   [deploy:deploy-file]   
  [DEBUG] Style:   Aggregating    
  [DEBUG] ======================================================================= 
  [INFO]                                                                          
  [INFO] ------------------------------------------------------------------------ 
  [INFO] Building myproject-war 1.0-SNAPSHOT  
  [INFO] ------------------------------------------------------------------------ 
  [DEBUG] Resolving plugin prefix deploy from [org.apache.maven.plugins, org.codehaus.mojo]   
  [DEBUG] Resolved plugin prefix deploy to org.apache.maven.plugins:maven-deploy-plugin from POM org.mainco.subco:myproject:war:1.0-SNAPSHOT  
  [DEBUG] Lifecycle default -&gt; [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]   
  [DEBUG] Lifecycle clean -&gt; [pre-clean, clean, post-clean]   
  [DEBUG] Lifecycle site -&gt; [pre-site, site, post-site, site-deploy]  
  [DEBUG] === PROJECT BUILD PLAN ================================================ 
  [DEBUG] Project:       org.mainco.subco:myproject:1.0-SNAPSHOT  
  [DEBUG] Dependencies (collect): []  
  [DEBUG] Dependencies (resolve): []  
  [DEBUG] Repositories (dependencies): [cloudbees-private (https://repository-myco.forge.cloudbees.com/private/, releases+snapshots), maven2-repository.dev.java.net (http://download.java.net/maven/2/, releases), central (http://repo.maven.apache.org/maven2, releases)]  
  [DEBUG] Repositories (plugins)     : [repository.jboss.org_thirdparty-releases (https://repository.jboss.org/nexus/content/repositories/thirdparty-releases, releases), repository.jboss.org_thirdparty-uploads (https://repository.jboss.org/nexus/content/repositories/thirdparty-uploads, releases), central (http://repo.maven.apache.org/maven2, releases)]    
  [DEBUG] ----------------------------------------------------------------------- 
  [DEBUG] Goal:          org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli)   
  [DEBUG] Style:         Regular  
  [DEBUG] Configuration: &lt;?xml version="1.0" encoding="UTF-8"?&gt;   
  &lt;configuration&gt; 
    &lt;artifactId&gt;${artifactId}&lt;/artifactId&gt;    
    &lt;classifier&gt;${classifier}&lt;/classifier&gt;    
    &lt;classifiers&gt;${classifiers}&lt;/classifiers&gt; 
    &lt;description&gt;${generatePom.description}&lt;/description&gt; 
    &lt;file&gt;${file}&lt;/file&gt;  
    &lt;files&gt;${files}&lt;/files&gt;   
    &lt;generatePom default-value="true"&gt;${generatePom}&lt;/generatePom&gt;    
    &lt;groupId&gt;${groupId}&lt;/groupId&gt; 
    &lt;javadoc&gt;${javadoc}&lt;/javadoc&gt; 
    &lt;localRepository default-value="${localRepository}"/&gt; 
    &lt;offline default-value="${settings.offline}"/&gt;    
    &lt;packaging&gt;${packaging}&lt;/packaging&gt;   
    &lt;pomFile&gt;${pomFile}&lt;/pomFile&gt; 
    &lt;project default-value="${project}"/&gt; 
    &lt;repositoryId default-value="remote-repository"&gt;${repositoryId}&lt;/repositoryId&gt;    
    &lt;repositoryLayout default-value="default"&gt;${repositoryLayout}&lt;/repositoryLayout&gt;  
    &lt;retryFailedDeploymentCount default-value="1"&gt;${retryFailedDeploymentCount}&lt;/retryFailedDeploymentCount&gt;  
    &lt;sources&gt;${sources}&lt;/sources&gt; 
    &lt;types&gt;${types}&lt;/types&gt;   
    &lt;uniqueVersion default-value="true"&gt;${uniqueVersion}&lt;/uniqueVersion&gt;  
    &lt;updateReleaseInfo default-value="false"&gt;${updateReleaseInfo}&lt;/updateReleaseInfo&gt; 
    &lt;url&gt;${url}&lt;/url&gt; 
    &lt;version&gt;${version}&lt;/version&gt; 
  &lt;/configuration&gt;    
  [DEBUG] ======================================================================= 
  [INFO]  
  [INFO] --- maven-deploy-plugin:2.7:deploy-file (default-cli) @ myproject ---    
  [DEBUG] Created new class realm maven.api   
  [DEBUG] Importing foreign packages into class realm maven.api   
  [DEBUG]   Imported: org.apache.maven.wagon.events &lt; plexus.core 
  [DEBUG]   Imported: org.sonatype.aether.transfer &lt; plexus.core  
  [DEBUG]   Imported: org.apache.maven.exception &lt; plexus.core    
  [DEBUG]   Imported: org.sonatype.aether.metadata &lt; plexus.core  
  [DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom &lt; plexus.core  
  [DEBUG]   Imported: org.sonatype.aether.collection &lt; plexus.core    
  [DEBUG]   Imported: org.sonatype.aether.version &lt; plexus.core   
  [DEBUG]   Imported: org.apache.maven.monitor &lt; plexus.core  
  [DEBUG]   Imported: org.apache.maven.wagon.repository &lt; plexus.core 
  [DEBUG]   Imported: org.apache.maven.repository &lt; plexus.core   
  [DEBUG]   Imported: org.apache.maven.wagon.resource &lt; plexus.core   
  [DEBUG]   Imported: org.codehaus.plexus.logging &lt; plexus.core   
  [DEBUG]   Imported: org.apache.maven.profiles &lt; plexus.core 
  [DEBUG]   Imported: org.sonatype.aether.repository &lt; plexus.core    
  [DEBUG]   Imported: org.apache.maven.classrealm &lt; plexus.core   
  [DEBUG]   Imported: org.apache.maven.execution &lt; plexus.core    
  [DEBUG]   Imported: org.sonatype.aether.artifact &lt; plexus.core  
  [DEBUG]   Imported: org.sonatype.aether.spi &lt; plexus.core   
  [DEBUG]   Imported: org.apache.maven.reporting &lt; plexus.core    
  [DEBUG]   Imported: org.apache.maven.usability &lt; plexus.core    
  [DEBUG]   Imported: org.codehaus.plexus.container &lt; plexus.core 
  [DEBUG]   Imported: org.codehaus.plexus.component &lt; plexus.core 
  [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer &lt; plexus.core   
  [DEBUG]   Imported: org.apache.maven.wagon.authentication &lt; plexus.core 
  [DEBUG]   Imported: org.apache.maven.lifecycle &lt; plexus.core    
  [DEBUG]   Imported: org.codehaus.plexus.classworlds &lt; plexus.core   
  [DEBUG]   Imported: org.sonatype.aether.graph &lt; plexus.core 
  [DEBUG]   Imported: org.sonatype.aether.* &lt; plexus.core 
  [DEBUG]   Imported: org.apache.maven.settings &lt; plexus.core 
  [DEBUG]   Imported: org.codehaus.classworlds &lt; plexus.core  
  [DEBUG]   Imported: org.sonatype.aether.impl &lt; plexus.core  
  [DEBUG]   Imported: org.apache.maven.wagon.* &lt; plexus.core  
  [DEBUG]   Imported: org.apache.maven.toolchain &lt; plexus.core    
  [DEBUG]   Imported: org.sonatype.aether.deployment &lt; plexus.core    
  [DEBUG]   Imported: org.apache.maven.wagon.observers &lt; plexus.core  
  [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException &lt; plexus.core  
  [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser &lt; plexus.core   
  [DEBUG]   Imported: org.apache.maven.configuration &lt; plexus.core    
  [DEBUG]   Imported: org.apache.maven.cli &lt; plexus.core  
  [DEBUG]   Imported: org.sonatype.aether.installation &lt; plexus.core  
  [DEBUG]   Imported: org.codehaus.plexus.context &lt; plexus.core   
  [DEBUG]   Imported: org.apache.maven.wagon.authorization &lt; plexus.core  
  [DEBUG]   Imported: org.apache.maven.project &lt; plexus.core  
  [DEBUG]   Imported: org.apache.maven.rtinfo &lt; plexus.core   
  [DEBUG]   Imported: org.codehaus.plexus.lifecycle &lt; plexus.core 
  [DEBUG]   Imported: org.codehaus.plexus.configuration &lt; plexus.core 
  [DEBUG]   Imported: org.apache.maven.artifact &lt; plexus.core 
  [DEBUG]   Imported: org.apache.maven.model &lt; plexus.core    
  [DEBUG]   Imported: org.apache.maven.* &lt; plexus.core    
  [DEBUG]   Imported: org.apache.maven.wagon.proxy &lt; plexus.core  
  [DEBUG]   Imported: org.sonatype.aether.resolution &lt; plexus.core    
  [DEBUG]   Imported: org.apache.maven.plugin &lt; plexus.core   
  [DEBUG]   Imported: org.codehaus.plexus.* &lt; plexus.core 
  [DEBUG]   Imported: org.codehaus.plexus.personality &lt; plexus.core   
  [DEBUG] Populating class realm maven.api    
  [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; maven.api    
  [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-file from plugin realm ClassRealm[plugin&gt;org.apache.maven.plugins:maven-deploy-plugin:2.7, parent: sun.misc.Launcher$AppClassLoader@69cd2e5f]  
  [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file' with basic configurator --&gt; 
  [DEBUG]   (f) artifactId = dwr  
  [DEBUG]   (f) file = /Users/davea/.m2/repository/org/directwebremoting/dwr/3.0.0-rc2/dwr-3.0.0-rc2.jar  
  [DEBUG]   (f) generatePom = true    
  [DEBUG]   (f) groupId = org.directwebremoting   
  [DEBUG]   (s) localRepository =        id: local    
        url: file:///Users/davea/.m2/repository/  
     layout: none 
  
  [DEBUG]   (f) offline = false   
  [DEBUG]   (f) packaging = jar   
  [DEBUG]   (f) project = MavenProject: org.mainco.subco:myproject:1.0-SNAPSHOT @ /Users/davea/Dropbox/workspace/myproject/pom.xml    
  [DEBUG]   (f) repositoryId = cloudbees-private  
  [DEBUG]   (f) repositoryLayout = default    
  [DEBUG]   (f) retryFailedDeploymentCount = 1    
  [DEBUG]   (f) uniqueVersion = true  
  [DEBUG]   (f) updateReleaseInfo = false 
  [DEBUG]   (f) url = dav:https://repository-myco.forge.cloudbees.com/private 
  [DEBUG]   (f) version = 3.0.0-rc2   
  [DEBUG] -- end configuration -- 
  [INFO] ------------------------------------------------------------------------ 
  [INFO] BUILD FAILURE    
  [INFO] ------------------------------------------------------------------------ 
  [INFO] Total time: 0.662s   
  [INFO] Finished at: Tue Jan 08 14:02:33 CST 2013    
  [INFO] Final Memory: 4M/81M 
  [INFO] ------------------------------------------------------------------------ 
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project myproject: Cannot deploy artifact from the local repository: /Users/davea/.m2/repository/org/directwebremoting/dwr/3.0.0-rc2/dwr-3.0.0-rc2.jar -&gt; [Help 1] 
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project myproject: Cannot deploy artifact from the local repository: /Users/davea/.m2/repository/org/directwebremoting/dwr/3.0.0-rc2/dwr-3.0.0-rc2.jar 
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)  
      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:39)    
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    
      at java.lang.reflect.Method.invoke(Method.java:597) 
      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:409)    
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)    
  Caused by: org.apache.maven.plugin.MojoFailureException: Cannot deploy artifact from the local repository: /Users/davea/.m2/repository/org/directwebremoting/dwr/3.0.0-rc2/dwr-3.0.0-rc2.jar    
      at org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:283)   
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)    
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)  
      ... 19 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/MojoFailureException
  </code></pre>
  
  <p>My ~.m2/settings.xml file</p>
  
  <pre><code>&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;profiles&gt;
     &lt;profile&gt;
       &lt;id&gt;default&lt;/id&gt;
       &lt;repositories&gt;
         &lt;repository&gt;
           &lt;id&gt;cloudbees-private&lt;/id&gt;
           &lt;name&gt;Cloudbees private repo&lt;/name&gt;
           &lt;url&gt;https://repository-myco.forge.cloudbees.com/private/&lt;/url&gt;
         &lt;/repository&gt;
       &lt;/repositories&gt;
     &lt;/profile&gt;
   &lt;/profiles&gt;
   &lt;activeProfiles&gt;
     &lt;activeProfile&gt;default&lt;/activeProfile&gt;
   &lt;/activeProfiles&gt;
  
  &lt;servers&gt;
      &lt;server&gt;
        &lt;username&gt;username&lt;/username&gt;
        &lt;password&gt;password&lt;/password&gt;
        &lt;id&gt;cloudbees-private&lt;/id&gt;
      &lt;/server&gt;
    &lt;/servers&gt;
  
  &lt;/settings&gt; 
  </code></pre>