Shaun
Shaun

Reputation: 775

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. UNIX system is a remote server.

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

Upvotes: 1

Views: 1846

Answers (1)

krock
krock

Reputation: 29619

take a look at the sshexec ant task. You will need a jsch library on the ant classpath and the UNIX server needs to be running a ssh daemon.

Upvotes: 3

Related Questions