Michael
Michael

Reputation: 22947

Is there an ant library to execute remote commands in an ant like fashion?

I am not talking about sshexec task, i want a lib that will allow me to use all the power of ant but instead of doing stuff locally it will do it on a remote host.

For example using copy, move rename and more but in a remote host and not locally.

I know sshexec can acheive similar things, but once i log in to the machine i have to use shell, instead i want to be able to use normal ant tasks.

EDIT:

I have just found out about sshsession task that lets you encapsulate ant tasks to run remotely, or at least thats what the manual says: http://ant.apache.org/manual/Tasks/sshsession.html

I have tested it with this simple build.xml:

<project name="project" default="default">

    <!-- ================================= 
          target: default              
         ================================= -->
    <target name="default" description="description">
        <sshsession host="${host}" username="${username}" password="${password}" trust="yes">
            <sequential>
                <mkdir dir="/tmp/sshtest"/>             
            </sequential>
        </sshsession>

    </target>


</project>

I get the following result when running it:

 default:

    [sshsession] Connecting to my.server
        [mkdir] Created dir: C:\tmp\sshtest
    BUILD SUCCESSFUL

Instead of creating the dir on the remote server it creates it locally on my PC. Any idea ?

Upvotes: 1

Views: 2260

Answers (1)

Tom Howard
Tom Howard

Reputation: 6687

I don't think it's quite what you are after by you could try AntServer / RemoteAnt from ant-contrib

Upvotes: 1

Related Questions