tags:

views:

636

answers:

1

I'm using ant-jsch-1.6.5 and jsch-0.1.41 and groovy-1.6.3 (which uses ant-1.7.1)

new AntBuilder().sequential{

def user = "user", pass = "pass", host = "host"

    echo "echo 1"
    sshexec(
        host:host ,username:user, password:pass, verbose:true, trust:true ,
        command:"touch 1.txt"
    )

    echo "echo 2"
    sshexec(
        host: host ,username:user, password:pass, verbose:true, trust:true ,
        command:"touch 2.txt"
    )
}

I can only see "echo 1" in the output while both 1.txt and 2.txt are created successfully. It seems that after the first sshexec, the output is blocked.

Any way to solve this?

A: 

It seems to be a bug on Ant 1.6.5:

http://mail-archives.apache.org/mod_mbox/ant-user/200508.mbox/%[email protected]%3E

https://issues.apache.org/bugzilla/show_bug.cgi?id=36302

Though if you are connecting to the same host/username you can issue multiple commands in the same task.

Lucas -luky- N.