Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-1900

Error while deploying when using scpexe protocol with non-default scp/ssh executables

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.2
    • None
    • None

    Description

      First I have not been able to use the scp protocol as there's a bug with jsch. This is a known bug as I was told on IRC. Thus I have tried to use the scpexe protocol:

      <distributionManagement>
      <repository>
      <id>cargo</id>
      <name>Cargo's private repository</name>
      <!-- Note: We're using scpexe protocol instead of scp because jsch has an issue (already
      reported) that makes it fail. Once it works switch back to scp protocol. -->
      <url>scpexe://beaver.codehaus.org/home/projects/cargo/dist2</url>
      </repository>
      </distributionManagement>

      In my settings.xml I have:

      <servers>
      <server>
      <id>cargo</id>
      <username>vmassol</username>
      <privateKey>...</privateKey>
      <filePermissions>664</filePermissions>
      <directoryPermissions>775</directoryPermissions>
      <configuration>
      <sshExecutable>tortoiseplink</sshExecutable>
      <scpExecutable>pscp</scpExecutable>
      </configuration>
      </server>
      </servers>

      However when I do a deploy I get the following:

      C:\dev\cargo\trunk>mvn -X -N deploy
      [...]
      [INFO] [deploy:deploy]
      [INFO] Retrieving previous build number from cargo
      Executing command: scp -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -o "BatchMode yes" vmassol@beaver.codehaus
      .org:/home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT/maven-metadata.xml maven-metadata-cargo.xml.tmp
      [WARNING] repository metadata for: 'snapshot org.codehaus.cargo:cargo:0.7-SNAPSHOT' could not be retrieved from repository: cargo
      due to an error: Exit code: 1 - 'scp' is not recognized as an internal or external command,
      operable program or batch file.

      [INFO] Repository 'cargo' will be blacklisted
      [DEBUG] Exception
      org.apache.maven.wagon.TransferFailedException: Exit code: 1 - 'scp' is not recognized as an internal or external command,
      operable program or batch file.

      at org.apache.maven.wagon.providers.sshext.ScpExternalWagon.executeScpCommand(ScpExternalWagon.java:294)
      at org.apache.maven.wagon.providers.sshext.ScpExternalWagon.get(ScpExternalWagon.java:375)
      at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:367)
      at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifactMetadata(DefaultWagonManager.java:295)
      at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolveAlways(DefaultRepositoryMetadataM
      anager.java:356)
      at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolveAlways(DefaultRepositoryMetadataM
      anager.java:310)
      at org.apache.maven.artifact.transform.SnapshotTransformation.resolveLatestSnapshotBuildNumber(SnapshotTransformation.java
      :158)
      at org.apache.maven.artifact.transform.SnapshotTransformation.transformForDeployment(SnapshotTransformation.java:97)
      at org.apache.maven.artifact.transform.DefaultArtifactTransformationManager.transformForDeployment(DefaultArtifactTransfor
      mationManager.java:61)
      at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:68)
      at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:137)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:519)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:469)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:448)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:301)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:268)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:137)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
      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:324)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      done
      [DEBUG] adding permissions to wagon connection: 664 775
      Uploading: scpexe://beaver.codehaus.org/home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT/cargo-0.7-20051116.105000-
      3.pom
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "mkdir -p /home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT
      "
      Executing command: pscp -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch pom.xml vmassol@beaver.codehaus.or
      g:/home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT/cargo-0.7-20051116.105000-3.pom
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "chmod -f 664 /home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT/cargo-0.7-20051116.105000-3.pom
      "
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "mkdir -p /home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT
      "
      Executing command: pscp -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch maven-artifact30448.tmp vmassol@be
      aver.codehaus.org:/home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT/cargo-0.7-20051116.105000-3.pom.md5
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "chmod -f 664 /home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT/cargo-0.7-20051116.105000-3.pom.md5
      "
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "mkdir -p /home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT
      "
      Executing command: pscp -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch maven-artifact30449.tmp vmassol@be
      aver.codehaus.org:/home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT/cargo-0.7-20051116.105000-3.pom.sha1
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "chmod -f 664 /home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT/cargo-0.7-20051116.105000-3.pom.sha1
      "
      [INFO] Retrieving previous metadata from cargo
      Executing command: scp -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -o "BatchMode yes" vmassol@beaver.codehaus
      .org:/home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT/maven-metadata.xml maven-metadata-cargo.xml.tmp
      [WARNING] repository metadata for: 'snapshot org.codehaus.cargo:cargo:0.7-SNAPSHOT' could not be retrieved from repository: cargo
      due to an error: Exit code: 1 - 'scp' is not recognized as an internal or external command,
      operable program or batch file.

      [INFO] Repository 'cargo' will be blacklisted
      [DEBUG] Exception
      org.apache.maven.wagon.TransferFailedException: Exit code: 1 - 'scp' is not recognized as an internal or external command,
      operable program or batch file.

      at org.apache.maven.wagon.providers.sshext.ScpExternalWagon.executeScpCommand(ScpExternalWagon.java:294)
      at org.apache.maven.wagon.providers.sshext.ScpExternalWagon.get(ScpExternalWagon.java:375)
      at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:367)
      at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifactMetadata(DefaultWagonManager.java:295)
      at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolveAlways(DefaultRepositoryMetadataM
      anager.java:356)
      at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.deploy(DefaultRepositoryMetadataManager.
      java:403)
      at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:83)
      at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:137)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:519)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:469)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:448)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:301)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:268)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:137)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
      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:324)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      [INFO] Uploading repository metadata for: 'snapshot org.codehaus.cargo:cargo:0.7-SNAPSHOT'
      done
      [DEBUG] adding permissions to wagon connection: 664 775
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "mkdir -p /home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT
      "
      Executing command: pscp -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch maven-metadata-cargo.xml vmassol@b
      eaver.codehaus.org:/home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT/maven-metadata.xml
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "chmod -f 664 /home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT/maven-metadata.xml
      "
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "mkdir -p /home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT
      "
      Executing command: pscp -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch maven-artifact30450.tmp vmassol@be
      aver.codehaus.org:/home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT/maven-metadata.xml.md5
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "chmod -f 664 /home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT/maven-metadata.xml.md5
      "
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "mkdir -p /home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT
      "
      Executing command: pscp -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch maven-artifact30451.tmp vmassol@be
      aver.codehaus.org:/home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT/maven-metadata.xml.sha1
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "chmod -f 664 /home/projects/cargo/dist2/org/codehaus/cargo/cargo/0.7-SNAPSHOT/maven-metadata.xml.sha1
      "
      [INFO] Retrieving previous metadata from cargo
      Executing command: scp -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -o "BatchMode yes" vmassol@beaver.codehaus
      .org:/home/projects/cargo/dist2/org/codehaus/cargo/cargo/maven-metadata.xml maven-metadata-cargo.xml.tmp
      [WARNING] repository metadata for: 'artifact org.codehaus.cargo:cargo' could not be retrieved from repository: cargo due to an err
      or: Exit code: 1 - 'scp' is not recognized as an internal or external command,
      operable program or batch file.

      [INFO] Repository 'cargo' will be blacklisted
      [DEBUG] Exception
      org.apache.maven.wagon.TransferFailedException: Exit code: 1 - 'scp' is not recognized as an internal or external command,
      operable program or batch file.

      at org.apache.maven.wagon.providers.sshext.ScpExternalWagon.executeScpCommand(ScpExternalWagon.java:294)
      at org.apache.maven.wagon.providers.sshext.ScpExternalWagon.get(ScpExternalWagon.java:375)
      at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:367)
      at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifactMetadata(DefaultWagonManager.java:295)
      at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolveAlways(DefaultRepositoryMetadataM
      anager.java:356)
      at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.deploy(DefaultRepositoryMetadataManager.
      java:403)
      at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:83)
      at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:137)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:519)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:469)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:448)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:301)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:268)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:137)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
      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:324)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      [INFO] Uploading repository metadata for: 'artifact org.codehaus.cargo:cargo'
      done
      [DEBUG] adding permissions to wagon connection: 664 775
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "mkdir -p /home/projects/cargo/dist2/org/codehaus/cargo/cargo
      "
      Executing command: pscp -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch maven-metadata-cargo.xml vmassol@b
      eaver.codehaus.org:/home/projects/cargo/dist2/org/codehaus/cargo/cargo/maven-metadata.xml
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "chmod -f 664 /home/projects/cargo/dist2/org/codehaus/cargo/cargo/maven-metadata.xml
      "
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "mkdir -p /home/projects/cargo/dist2/org/codehaus/cargo/cargo
      "
      Executing command: pscp -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch maven-artifact30452.tmp vmassol@be
      aver.codehaus.org:/home/projects/cargo/dist2/org/codehaus/cargo/cargo/maven-metadata.xml.md5
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "chmod -f 664 /home/projects/cargo/dist2/org/codehaus/cargo/cargo/maven-metadata.xml.md5
      "
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "mkdir -p /home/projects/cargo/dist2/org/codehaus/cargo/cargo
      "
      Executing command: pscp -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch maven-artifact30453.tmp vmassol@be
      aver.codehaus.org:/home/projects/cargo/dist2/org/codehaus/cargo/cargo/maven-metadata.xml.sha1
      Executing command: tortoiseplink -i C:\DOCUME~1\VINCEN~1\MYDOCU~1\.ssh\vmassol.ssh2.private.putty -batch vmassol@beaver.codehaus.o
      rg "chmod -f 664 /home/projects/cargo/dist2/org/codehaus/cargo/cargo/maven-metadata.xml.sha1
      "
      [INFO] ----------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ----------------------------------------------------------------------------
      [INFO] Total time: 2 minutes 23 seconds
      [INFO] Finished at: Wed Nov 16 11:52:15 CET 2005
      [INFO] Final Memory: 2M/4M
      [INFO] ----------------------------------------------------------------------------

      C:\dev\cargo\trunk>

      As you can see it seems to work and indeed what's on the server looks ok. What John Casey suggested is that it may fail in the merge metadata step.

      It seems there's a bug in the code which is using "scp" instead of the executable specified in the settings.

      Attachments

        1. MDEPLOY-13.diff
          0.5 kB
          Brett Porter

        Issue Links

          Activity

            People

              carlos Carlos Sanchez Gonzalez
              vmassol Vincent Massol
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: