views:

19

answers:

1

Is it possible to have ANT restart your java application on a remote server from a build script? If so any pointers to where that might be defined?

I'm using ant now to push the new code over to the remote server but I still have to login to actually restart the app

+1  A: 

Using the <sshexec> task you can do pretty much anything on a remote machine (assuming it's got an sshd running). If you don't want to worry about authenticating the ssh session every time, you can set up RSA keys.

<sshexec host="remotehost" username="remoteuser" command="/restart/application/command"/>

Heed the statement at the beginning of the above link:

This task depends on external libraries

You'll need to grab JCraft's JSch jar and put it on Ant's classpath.

Rob Hruska
perfect, thanks rob