简体   繁体   English

如何使用ANT从Windows XP系统执行UNIX命令

[英]How to execute UNIX command from Windows XP system using ANT

I want to execute a UNIX command from my local Windows XP system using ANT script. 我想使用ANT脚本从本地Windows XP系统执行UNIX命令。 UNIX system is a remote server. UNIX系统是远程服务器。

I have tried the following: 我尝试了以下方法:

  <target name="execute" >
    <sshexec host="host IP" 
    username="uname" 
    password="pass" 
    commandResource="sh abc.sh"/>
  </target>

but got the error below: 但出现以下错误:

 BUILD FAILED
 ..\build.xml:49: com.jcraft.jsch.JSchException:     connection is closed by foreign
 host

take a look at the sshexec ant task. 看一下sshexec ant任务。 You will need a jsch library on the ant classpath and the UNIX server needs to be running a ssh daemon. 您将在ant类路径上需要一个jsch库,并且UNIX服务器需要运行ssh守护程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM