title: Deploying to New Internal Maven Repository
body: <p>I have a completely empty file system set up as an internal Maven Repository.
  I am trying to deploy to this Repository via SFTP.</p>
  
  <p>This is the first jar that I am deploying to the Repository and as I understand it is is possible to point it at a blank writable directory and maven will build up all the correct files.</p>
  
  <p>When running the deploy target I get the following errors:</p>
  
  <pre><code>[INFO] Downloading: scpexe://mvn.metcarob.com:7456/public/metcarob/com/BobDiary/BobDiary/0.0.1-SNAPSHOT/maven-metadata.xml
  [WARNING] Could not transfer metadata metcarob.com.BobDiary:BobDiary:0.0.1-SNAPSHOT/maven-metadata.xml from/to ssh-repository (scpexe://mvn.metcarob.com:7456/public): Exit code: 1 - Connected to mvn.metcarob.com.
  File "/public/metcarob/com/BobDiary/BobDiary/0.0.1-SNAPSHOT/maven-metadata.xml" not found.
  
  org.eclipse.aether.transfer.MetadataTransferException: Could not transfer metadata metcarob.com.BobDiary:BobDiary:0.0.1-SNAPSHOT/maven-metadata.xml from/to ssh-repository (scpexe://mvn.metcarob.com:7456/public): Exit code: 1 - Connected to mvn.metcarob.com.
  File "/public/metcarob/com/BobDiary/BobDiary/0.0.1-SNAPSHOT/maven-metadata.xml" not found.
  
      at org.eclipse.aether.connector.basic.MetadataTransportListener.transferFailed(MetadataTransportListener.java:43)
      at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
      at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
      at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
      at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:222)
      at org.eclipse.aether.internal.impl.DefaultDeployer.upload(DefaultDeployer.java:417)
      at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:290)
      at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:245)
      at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:413)
      at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:139)
      at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:167)
      at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:157)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
      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:128)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      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.wagon.TransferFailedException: Exit code: 1 - Connected to mvn.metcarob.com.
  File "/public/metcarob/com/BobDiary/BobDiary/0.0.1-SNAPSHOT/maven-metadata.xml" not found.
  
      at org.apache.maven.wagon.providers.ssh.external.ScpExternalWagon.executeScpCommand(ScpExternalWagon.java:320)
      at org.apache.maven.wagon.providers.ssh.external.ScpExternalWagon.get(ScpExternalWagon.java:444)
      at org.eclipse.aether.transport.wagon.WagonTransporter$GetTaskRunner.run(WagonTransporter.java:560)
      at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:427)
      at org.eclipse.aether.transport.wagon.WagonTransporter.get(WagonTransporter.java:404)
      at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:447)
      at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
      ... 32 more
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 3.058 s
  [INFO] Finished at: 2016-07-16T16:25:36+01:00
  [INFO] Final Memory: 24M/630M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project BobDiary: Failed to retrieve remote metadata metcarob.com.BobDiary:BobDiary:0.0.1-SNAPSHOT/maven-metadata.xml: Could not transfer metadata metcarob.com.BobDiary:BobDiary:0.0.1-SNAPSHOT/maven-metadata.xml from/to ssh-repository (scpexe://mvn.metcarob.com:7456/public): Exit code: 1 - Connected to mvn.metcarob.com.
  [ERROR] File "/public/metcarob/com/BobDiary/BobDiary/0.0.1-SNAPSHOT/maven-metadata.xml" not found.
  [ERROR] -&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 BobDiary: Failed to retrieve remote metadata metcarob.com.BobDiary:BobDiary:0.0.1-SNAPSHOT/maven-metadata.xml: Could not transfer metadata metcarob.com.BobDiary:BobDiary:0.0.1-SNAPSHOT/maven-metadata.xml from/to ssh-repository (scpexe://mvn.metcarob.com:7456/public): Exit code: 1 - Connected to mvn.metcarob.com.
  File "/public/metcarob/com/BobDiary/BobDiary/0.0.1-SNAPSHOT/maven-metadata.xml" not found.
  
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
      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:128)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      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 retrieve remote metadata metcarob.com.BobDiary:BobDiary:0.0.1-SNAPSHOT/maven-metadata.xml: Could not transfer metadata metcarob.com.BobDiary:BobDiary:0.0.1-SNAPSHOT/maven-metadata.xml from/to ssh-repository (scpexe://mvn.metcarob.com:7456/public): Exit code: 1 - Connected to mvn.metcarob.com.
  File "/public/metcarob/com/BobDiary/BobDiary/0.0.1-SNAPSHOT/maven-metadata.xml" not found.
  
      at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:193)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
      ... 20 more
  Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to retrieve remote metadata metcarob.com.BobDiary:BobDiary:0.0.1-SNAPSHOT/maven-metadata.xml: Could not transfer metadata metcarob.com.BobDiary:BobDiary:0.0.1-SNAPSHOT/maven-metadata.xml from/to ssh-repository (scpexe://mvn.metcarob.com:7456/public): Exit code: 1 - Connected to mvn.metcarob.com.
  File "/public/metcarob/com/BobDiary/BobDiary/0.0.1-SNAPSHOT/maven-metadata.xml" not found.
  
      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:157)
      ... 22 more
  Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to retrieve remote metadata metcarob.com.BobDiary:BobDiary:0.0.1-SNAPSHOT/maven-metadata.xml: Could not transfer metadata metcarob.com.BobDiary:BobDiary:0.0.1-SNAPSHOT/maven-metadata.xml from/to ssh-repository (scpexe://mvn.metcarob.com:7456/public): Exit code: 1 - Connected to mvn.metcarob.com.
  File "/public/metcarob/com/BobDiary/BobDiary/0.0.1-SNAPSHOT/maven-metadata.xml" not found.
  
      at org.eclipse.aether.internal.impl.DefaultDeployer.upload(DefaultDeployer.java:447)
      at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:290)
      at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:245)
      at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:413)
      at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:139)
      ... 24 more
  Caused by: org.eclipse.aether.transfer.MetadataTransferException: Could not transfer metadata metcarob.com.BobDiary:BobDiary:0.0.1-SNAPSHOT/maven-metadata.xml from/to ssh-repository (scpexe://mvn.metcarob.com:7456/public): Exit code: 1 - Connected to mvn.metcarob.com.
  File "/public/metcarob/com/BobDiary/BobDiary/0.0.1-SNAPSHOT/maven-metadata.xml" not found.
  
      at org.eclipse.aether.connector.basic.MetadataTransportListener.transferFailed(MetadataTransportListener.java:43)
      at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
      at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
      at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
      at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:222)
      at org.eclipse.aether.internal.impl.DefaultDeployer.upload(DefaultDeployer.java:417)
      ... 28 more
  Caused by: org.apache.maven.wagon.TransferFailedException: Exit code: 1 - Connected to mvn.metcarob.com.
  File "/public/metcarob/com/BobDiary/BobDiary/0.0.1-SNAPSHOT/maven-metadata.xml" not found.
  
      at org.apache.maven.wagon.providers.ssh.external.ScpExternalWagon.executeScpCommand(ScpExternalWagon.java:320)
      at org.apache.maven.wagon.providers.ssh.external.ScpExternalWagon.get(ScpExternalWagon.java:444)
      at org.eclipse.aether.transport.wagon.WagonTransporter$GetTaskRunner.run(WagonTransporter.java:560)
      at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:427)
      at org.eclipse.aether.transport.wagon.WagonTransporter.get(WagonTransporter.java:404)
      at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:447)
      at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
      ... 32 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>The gist of the error message is:
  File "/public/metcarob/com/BobDiary/BobDiary/0.0.1-SNAPSHOT/maven-metadata.xml" not found.</p>
  
  <p>Of course this file isn't found. It is not in the repository as I am in the process of deploying it. I am expecting this process to create this file.
  As this is the first time the jar is being deployed to any repository the file can no possibly exist.</p>
  
  <p>The distribution part of my POM is:</p>
  
  <pre><code>  &lt;distributionManagement&gt;
      &lt;repository&gt;
        &lt;id&gt;ssh-repository&lt;/id&gt;
              &lt;name&gt;ssh-repository&lt;/name&gt;
        &lt;url&gt;scpexe://mvn.metcarob.com:71234/public&lt;/url&gt;
      &lt;/repository&gt;
    &lt;/distributionManagement&gt; 
  </code></pre>
  
  <p>Are there any settings/methods that I have missed?</p>
  
  <p>(I am running maven via eclipse m2e)</p>
  
  <p>UPDATE:
  Some extra information.
  In my POM I have </p>
  
  <pre><code>  &lt;!-- Enabling the use of SSH --&gt;
    &lt;extension&gt;
      &lt;groupId&gt;org.apache.maven.wagon&lt;/groupId&gt;
       &lt;artifactId&gt;wagon-ssh-external&lt;/artifactId&gt;
  
       &lt;version&gt;2.10&lt;/version&gt;
    &lt;/extension&gt;
  </code></pre>
  
  <p>and my settings.xml is:</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
                            https://maven.apache.org/xsd/settings-1.0.0.xsd"&gt;
        &lt;localRepository/&gt;
        &lt;interactiveMode/&gt;
        &lt;usePluginRegistry/&gt;
        &lt;offline/&gt;
        &lt;pluginGroups/&gt;
        &lt;servers&gt;
            &lt;server&gt;
                &lt;id&gt;ssh-repository&lt;/id&gt;
                &lt;username&gt;maven_repo&lt;/username&gt;
                &lt;configuration&gt;
                    &lt;sshExecutable&gt;plink&lt;/sshExecutable&gt;
                    &lt;scpExecutable&gt;sftp&lt;/scpExecutable&gt;
                    &lt;sshArgs&gt;&lt;/sshArgs&gt;
                    &lt;scpArgs&gt;-o UserKnownHostsFile=/home/robert/.ssh/known_hosts&lt;/scpArgs&gt;
                &lt;/configuration&gt;
              &lt;!-- &lt;filePermissions&gt;664&lt;/filePermissions&gt;
              &lt;directoryPermissions&gt;775&lt;/directoryPermissions&gt; --&gt;
            &lt;/server&gt;
        &lt;/servers&gt;
        &lt;mirrors/&gt;
        &lt;proxies/&gt;
        &lt;profiles/&gt;
        &lt;activeProfiles/&gt;
  &lt;/settings&gt;
  </code></pre>
  
  <p>As far as I can see I have followed all the steps from <a href="http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ssh-external.html" rel="nofollow">http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ssh-external.html</a></p>