title: Maven error when i try to run it using mvn -e -X deploy using wagon SCP
body: <p>I am trying to copy the resources to a server using <code>scp</code> with <code>wagon</code>. </p>
  
  <p>What is the purpose of adding repository under <code>distributionManagement</code>?</p>
  
  <p>My <code>pom.xml</code> looks like this</p>
  
  <pre><code>&lt;distributionManagement&gt;
              &lt;repository&gt;
                  &lt;id&gt;iq&lt;/id&gt;
                  &lt;url&gt;ftp://server:port&lt;/url&gt;
              &lt;/repository&gt;
  &lt;/distributionManagement&gt;
  &lt;build&gt;
      &lt;extensions&gt;
          &lt;extension&gt;
              &lt;groupId&gt;org.apache.maven.wagon&lt;/groupId&gt;
              &lt;artifactId&gt;wagon-ftp&lt;/artifactId&gt;
              &lt;version&gt;1.0-beta-6&lt;/version&gt;
          &lt;/extension&gt;
      &lt;/extensions&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;wagon-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.0-beta-3&lt;/version&gt;
               &lt;extensions&gt;true&lt;/extensions&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;deploy&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;copy&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;serverId&gt;iq&lt;/serverId&gt;
                          &lt;fromDir&gt;src/main/webapps&lt;/fromDir&gt;
                          &lt;url&gt;scp:ftp://server:port&lt;/url&gt;
                          &lt;toDir&gt;.iq/resources/&lt;/toDir&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  </code></pre>
  
  <p>And my settings.xml file is </p>
  
  <pre><code>&lt;servers&gt;
      &lt;server&gt;
        &lt;id&gt;iq&lt;/id&gt;
        &lt;username&gt;user&lt;/username&gt;
        &lt;password&gt;pass&lt;/password&gt;      
      &lt;/server&gt;
  &lt;/servers&gt;
  </code></pre>
  
  <p>*<em>Error is *</em></p>
  
  <pre><code>    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project iq-resources: Failed to deploy artifacts: Could not transfer artifact test.com.test:resources:jar:2.50.6.a from/to iq (ftp://server:port): Could not connect to server. Could not parse response code.
  [ERROR] Server Reply: SSH-2.0-OpenSSH_4.3
  [ERROR] -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project iq-resources: Failed to deploy artifacts: Could not transfer artifact test.com.test:resources:jar:2.50.6.a from/to  (ftp://server:port): Could not connect to server.
      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:319)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
      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.MojoExecutionException: Failed to deploy artifacts: Could not transfer artifact :resources:jar:2.50.6.a from/to iq (ftp://server:port): Could not connect to server.
      at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:189)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
      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 resources:jar:2.50.6.a from/to iq (ftp://server:port): Could not connect to server.
      at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:140)
      at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:156)
      ... 21 more
  Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact resources:jar:2.50.6.a from/to iq (ftp://server:port): Could not connect to server.
      at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:259)
      at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:380)
      at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:136)
      ... 22 more
  Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact  resources:jar:2.50.6.a from/to iq (ftp://server:port): Could not connect to server.
      at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:949)
      at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:940)
      at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.flush(WagonRepositoryConnector.java:864)
      at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:465)
      at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:253)
      ... 24 more
  Caused by: org.apache.maven.wagon.authentication.AuthenticationException: Could not connect to server.
      at org.apache.maven.wagon.providers.ftp.FtpWagon.openConnectionInternal(FtpWagon.java:154)
      at org.apache.maven.wagon.AbstractWagon.openConnection(AbstractWagon.java:105)
      at org.apache.maven.wagon.AbstractWagon.connect(AbstractWagon.java:207)
      at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.connectWagon(WagonRepositoryConnector.java:326)
      at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.pollWagon(WagonRepositoryConnector.java:366)
      at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:817)
      at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:464)
      ... 25 more
  Caused by: org.apache.commons.net.MalformedServerReplyException: Could not parse response code.
  Server Reply: SSH-2.0-OpenSSH_4.3
      at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:315)
      at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:364)
      at org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:540)
      at org.apache.commons.net.SocketClient.connect(SocketClient.java:178)
      at org.apache.maven.wagon.providers.ftp.FtpWagon.openConnectionInternal(FtpWagon.java:119)
      ... 31 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>