Ant SCP任务不工作-我可以在哪里使用cygwin进行SCP
请为我在工作中面临的问题提供您的专家选择Ant SCP任务不工作-我可以在哪里使用cygwin进行SCP,ant,maven,scp,jsch,Ant,Maven,Scp,Jsch,请为我在工作中面临的问题提供您的专家选择 Ant SCP任务不工作-我可以在哪里使用cygwin进行SCP 本地环境:windows 7 64位、Jdk 1.6.0.24、Ant-1.8.2(获取Ant可选依赖项)、maven 2(usign Ant运行插件)、jsch-0.1.44 远程环境:VM Labmanager 4.0、Windows Server 2008-R2、SSH-2.0-OpenSSH_5.8、JDK 1.6.0.24 我已将密码验证设置为“是”,并在远程主机上重新启动了ss
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3224: debug1: fd 5 clearing O_NONBLOCK
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3224: debug1: Forked child 3364.
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3364: debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3364: debug1: inetd sockets after dupping: 3, 3
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3364: Connection from **.**.**.** port 44082
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3364: debug1: Client protocol version 2.0; client software version JSCH-0.1.38
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3364: debug1: no match: JSCH-0.1.38
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3364: debug1: Enabling compatibility mode for protocol 2.0
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3364: debug1: Local version string SSH-2.0-OpenSSH_5.8
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: list_hostkey_types: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: SSH2_MSG_KEXINIT sent
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: SSH2_MSG_KEXINIT received
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: kex: client->server aes128-cbc hmac-md5 none
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: kex: server->client aes128-cbc hmac-md5 none
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: expecting SSH2_MSG_KEXDH_INIT
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: SSH2_MSG_NEWKEYS sent
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: expecting SSH2_MSG_NEWKEYS
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: SSH2_MSG_NEWKEYS received
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: KEX done
Sep 21 13:45:47 DEV-JBOSS02 sshd: PID 3924: debug1: userauth-request for user devlocal service ssh-connection method none
Sep 21 13:45:47 DEV-JBOSS02 sshd: PID 3924: debug1: attempt 0 failures 0
Sep 21 13:45:49 DEV-JBOSS02 sshd: PID 3364: reverse mapping checking getaddrinfo for sjcgnaval1 [10.32.102.33] failed - POSSIBLE BREAK-IN ATTEMPT!
gnaval您是否已在ant安装可以看到的地方安装了JSch库?明确指出这是必要的: 注意:此任务依赖于Ant中未包含的外部库 分配。有关更多信息,请参阅 你会发现的 jsch.jar 0.1.50或更高版本 是SCP任务所必需的
:尝试使用Maven 3,Maven 2嵌入jsch 0.1.38,并且优先于插件依赖项中指定的版本。这在Maven 3中得到了解决。没有必要求助于
Ant
。您可以使用ApacheMaven插件。请看。
$ mvn -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
...
[INFO] Executing tasks
main:
[scp] Connecting to dev-jboss02.com:22
[scp] Connecting to dev-jboss02.com port 22
[scp] Connection established
[scp] Remote version string: SSH-2.0-OpenSSH_5.8
[scp] Local version string: SSH-2.0-JSCH-0.1.38
[scp] CheckCiphers: aes256-cbc,aes192-cbc,aes128-cbc
[scp] aes256-cbc is not available.
[scp] aes192-cbc is not available.
[scp] SSH_MSG_KEXINIT sent
[scp] SSH_MSG_KEXINIT received
[scp] kex: server->client aes128-cbc hmac-md5 none
[scp] kex: client->server aes128-cbc hmac-md5 none
[scp] SSH_MSG_KEXDH_INIT sent
[scp] expecting SSH_MSG_KEXDH_REPLY
[scp] ssh_rsa_verify: signature true
[scp] Permanently added 'dev-jboss02.com' (RSA) to the list of known hosts.
[scp] SSH_MSG_NEWKEYS sent
[scp] SSH_MSG_NEWKEYS received
[scp] SSH_MSG_SERVICE_REQUEST sent
[scp] SSH_MSG_SERVICE_ACCEPT received
[scp] Authentications that can continue: publickey,keyboard-interactive,password
[scp] Next authentication method: publickey
[scp] Authentications that can continue: keyboard-interactive,password
[scp] Next authentication method: keyboard-interactive
[scp] Authentications that can continue: password
[scp] Next authentication method: password
[scp] Disconnecting from dev-jboss02.com port 22
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An Ant BuildException has occured: com.jcraft.jsch.JSchException: Auth fail
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: An Ant BuildException has occured: com.jcraft.jsch.JSchException: Auth fail
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.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)
Caused by: org.apache.maven.plugin.MojoExecutionException: An Ant BuildException has occured: com.jcraft.jsch.JSchException: Auth fa
il
at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:283)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
Caused by: C:workspace\trunk\pix-test-automation\target\antrun\build-main.xml:4: com.jcraft.jsch.JSchException: Aut
h fail
at org.apache.tools.ant.taskdefs.optional.ssh.Scp.execute(Scp.java:245)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
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.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3224: debug1: fd 5 clearing O_NONBLOCK
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3224: debug1: Forked child 3364.
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3364: debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3364: debug1: inetd sockets after dupping: 3, 3
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3364: Connection from **.**.**.** port 44082
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3364: debug1: Client protocol version 2.0; client software version JSCH-0.1.38
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3364: debug1: no match: JSCH-0.1.38
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3364: debug1: Enabling compatibility mode for protocol 2.0
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3364: debug1: Local version string SSH-2.0-OpenSSH_5.8
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: list_hostkey_types: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: SSH2_MSG_KEXINIT sent
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: SSH2_MSG_KEXINIT received
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: kex: client->server aes128-cbc hmac-md5 none
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: kex: server->client aes128-cbc hmac-md5 none
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: expecting SSH2_MSG_KEXDH_INIT
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: SSH2_MSG_NEWKEYS sent
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: expecting SSH2_MSG_NEWKEYS
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: SSH2_MSG_NEWKEYS received
Sep 21 13:45:46 DEV-JBOSS02 sshd: PID 3924: debug1: KEX done
Sep 21 13:45:47 DEV-JBOSS02 sshd: PID 3924: debug1: userauth-request for user devlocal service ssh-connection method none
Sep 21 13:45:47 DEV-JBOSS02 sshd: PID 3924: debug1: attempt 0 failures 0
Sep 21 13:45:49 DEV-JBOSS02 sshd: PID 3364: reverse mapping checking getaddrinfo for sjcgnaval1 [10.32.102.33] failed - POSSIBLE BREAK-IN ATTEMPT!