我正在尝试使用Gradle SSH插件将文件从本地计算机传输到远程计算机。
这是我的代码:
//build.gradleplugins {
id 'org.hidetake.ssh' version '2.9.0'}// Global settingslssh.settings {
knownHosts = allowAnyHosts // Disable host key verification}// Add a remote hostssh.remotes {
webServer {
host = '52.xxx.xxx.xxx'
user = 'me'
password = 'xxxxx'
}
}task deploy() << {
ssh.run {
session(ssh.remotes.webServer) {
put 'D:\\a\\a.txt', 'C:/webapps'
}
}
}
当我运行部署任务时,出现以下错误:
Execution failed for task ':deploy'.
com.jcraft.jsch.JSchException: java.net.ConnectException: Connection timed out: connect